Fix sn.exe not found in PATH during strong name signing#4923
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a build failure when using dotnet msbuild on Windows by locating the sn.exe tool needed for strong name signing. The issue occurs because sn.exe is not in the PATH by default on GitHub Actions Windows runners, and the NetFxToolsDirectory property is not set when using dotnet msbuild.
Changes:
- Added fallback logic to locate
sn.exeacross multiple Windows SDK installation paths - Added validation to fail fast with a helpful error message if
sn.execannot be found - Updated the signing command to use the discovered
sn.exepath instead of relying on PATH
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pepone
force-pushed
the
jose/fix-sn-path
branch
from
January 22, 2026 12:10
a5ac85c to
37a84e9
Compare
externl
approved these changes
Jan 22, 2026
| <AssemblyOriginatorKeyFile Condition="'$(PUBLIC_KEYFILE)' == ''">$(KEYFILE)</AssemblyOriginatorKeyFile> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Locate sn.exe in Windows SDK. NetFxToolsDirectory is not set when using dotnet msbuild. --> |
Member
There was a problem hiding this comment.
Should we just ensure this is set in CI instead? Hardcoding various paths here seems brittle.
Member
Author
There was a problem hiding this comment.
Maybe use it from PATH, and update CI to add the correct directory to PATH?
Add the .NET Framework SDK tools directory to PATH in the build-dotnet-packages workflow to ensure sn.exe is available for strong name signing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pepone
force-pushed
the
jose/fix-sn-path
branch
from
January 22, 2026 16:23
37a84e9 to
4673f22
Compare
This was referenced Jan 27, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dotnet msbuildsn.exetool is not in PATH by default on GitHub Actions Windows runnerssn.exein Windows SDK directories (NETFX 4.8.2, 4.8.1, 4.8)Test plan
🤖 Generated with Claude Code