Skip to content

Fix friend assembly signing for MSTest projects - #176

Open
David Federman (dfederm) wants to merge 1 commit into
mainfrom
dfederm/fix-msbuildcache-friend-assembly-public-key
Open

Fix friend assembly signing for MSTest projects#176
David Federman (dfederm) wants to merge 1 commit into
mainfrom
dfederm/fix-msbuildcache-friend-assembly-public-key

Conversation

@dfederm

Copy link
Copy Markdown
Member

Summary

This fixes a signing-key mismatch when building test projects with SignType=Real. MSTest.Sdk marks test host applications with IsTestingPlatformApplication=true without setting IsTestProject, so the previous signing condition incorrectly assigned MicrosoftCorporation.snk to test assemblies. The updated condition excludes testing platform applications from the production-key path, allowing them to use the test signing key instead.

Production projects still resolve to MicrosoftCorporation.snk; only IsTestingPlatformApplication=true builds are diverted to Test.snk, matching the existing InternalsVisibleTo public key.

Validation

Test / build Result
dotnet build MSBuildCache.sln --configuration Release --no-restore -p:SignType=Real -p:MicroBuild_SigningTargetsImported=true Passed
Property evaluation for signing key selection MSTest projects use Test.snk; production projects use MicrosoftCorporation.snk
dotnet test for net9.0 Passed

@dfederm
David Federman (dfederm) enabled auto-merge (squash) August 25, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant