-
Notifications
You must be signed in to change notification settings - Fork 221
Closed
Labels
Description
Description
Release CI builds that run without ESRP signing enabled fail with CS0281 errors when compiling the Authentication.Test project:
nFriend access was granted by 'Microsoft.Graph.Authentication, Version=2.36.1.0, Culture=neutral, PublicKeyToken=null', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly. n
Root Cause
The InternalsVisibleTo attributes in both Authentication and Authentication.Core use #if DEBUG / #else to conditionally require a PublicKey in Release builds. This assumes Release always means signed, but some CI pipelines build in Release without -EnableSigning, causing a mismatch since neither assembly is strong-named.
Affected Files
src/Authentication/Authentication/Properties/AssemblyInfo.cssrc/Authentication/Authentication.Core/Properties/AssemblyInfo.cs
Proposed Fix
- Authentication: Remove the conditional entirely — this assembly is never delay-signed at compile time (
CSProjHelper.ps1doesn't modifyAuthentication.csproj). - Authentication.Core: Replace
#if DEBUGwith#if SIGNED_BUILDand defineSIGNED_BUILDin the.csprojwhenSignAssembly=true, so the condition tracks actual signing state.
Reactions are currently unavailable