Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to build in release configuration since version 4.52 for .Net 4.8 #4722

Open
lexus1991fi opened this issue Apr 19, 2024 · 2 comments

Comments

@lexus1991fi
Copy link

Library version used

4.52.0

.NET version

net4.8

Scenario

PublicClient - desktop app

Is this a new or an existing app?

The app is in production, and I have upgraded to a new version of MSAL

Issue description and reproduction steps

Hello. I tried to update my project nugets to recent version and ran into a problem

Here is csproj file of my empty (!) project.

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <UseWpf>true</UseWpf>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Identity.Client.Desktop" Version="4.52.0" />
  </ItemGroup>

</Project>

and this is Directory.Build.props file

<Project>
  <PropertyGroup>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
  </PropertyGroup>

  <PropertyGroup>
    <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
    <Configurations>Release;Debug</Configurations>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <CodeAnalysisRuleSet>Microsoft.ExtendedDesignGuidelines.ruleset</CodeAnalysisRuleSet>
    <Optimize>false</Optimize>
    <DebugType>full</DebugType>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <Optimize>true</Optimize>
    <DebugType>none</DebugType>
    <WarningLevel>2</WarningLevel>
  </PropertyGroup>
</Project>

and my compiler error output

Build started at 16:18...
1>------ Build started: Project: AnyLib, Configuration: Release Any CPU ------
1>CSC : error CS2045: /embed switch is only supported when emitting a PDB.
1>Done building project "AnyLib.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 16:18 and took 00,473 seconds ==========

If I change version from 4.52.0 to 4.51.0 or older build goes without any issues

Relevant code snippets

No response

Expected behavior

No response

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

4.51.0

Solution and workarounds

Works also in case of turned on debug pdb generation (non-release configuration)

@lexus1991fi lexus1991fi added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Apr 19, 2024
@bgavrilMS bgavrilMS added bug P2 public-client and removed untriaged Do not delete. Needed for Automation needs attention Delete label after triage labels Apr 23, 2024
@localden
Copy link
Collaborator

localden commented May 19, 2024

@lexus1991fi any reason you are using an outdated version of MSAL.NET? Have you tried this with 4.61.0 (latest Microsoft.Identity.Client)?

@bgavrilMS
Copy link
Member

I wonder if it is related to https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues?q=is%3Aissue+GeneratedAssemblyInfoFile+is%3Aopen

The "native interop" package injects some settings in the build pipeline because net48 doesn't play nice with native dependencies. See the props and targets file in https://nuget.info/packages/Microsoft.Identity.Client.NativeInterop/0.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants