Questions tagged [sn.exe]

For questions about Sn.exe (the Strong Name tool)

Documentation for Sn.exe can be found at https://learn.microsoft.com/en-us/dotnet/framework/tools/sn-exe-strong-name-tool

24 questions
54
votes
8 answers

Cannot find sn.exe to sign Assembly

I looked into C:\Program Files\Microsoft.NET and I can't see any SN.exe file. I have .NET 3.5 runtime installed; isn't that enough ?
programmernovice
  • 3,841
  • 11
  • 43
  • 63
36
votes
2 answers

Strong Name sn.exe: Failed to install key pair -- Object already exists

I have 2 different versions of the same project on my machine. One from the code trunk, and the other from a code branch. These projects use a .pfx key to enable strong naming. When I first tried to compile the trunk version of the project I get the…
ChrisG
  • 1,316
  • 1
  • 11
  • 14
15
votes
6 answers

sn.exe fails with Access Denied error message

I get an Access is Denied error message when I use the strong name tool to create a new key to sign a .NET assembly. This works just fine on a Windows XP machine but it does not work on my Vista machine. PS C:\users\brian\Dev\Projects\BELib\BELib>…
Brian Ensink
  • 11,092
  • 3
  • 50
  • 63
11
votes
7 answers

Auto-entering Password In Sn.exe

I need to create post build event to perform the following: sn -i MyKey.pfx MyKeyContainerName tlbimp $(ConfigurationName)\MyCom.tlb /out:$(ConfigurationName)\NETMyCom.dll /keycontainer:MyKeyContainerName sn -d MyKeyContainerName When the Visual…
HJ.
  • 185
  • 1
  • 2
  • 10
5
votes
1 answer

What windows SDK parts are needed to run sn.exe

I want to run sn.exe in order to be able to run a delayed signed project in a server. If I install the whole windows SDK everything runs smoothly, but which exact part of SDK is needed? I am asking since the whole downloading is 460Mb and probably…
andreadi
  • 1,953
  • 1
  • 20
  • 35
4
votes
1 answer

Can sn.exe utilize the Windows certificate store?

For signing an assembly with sn.exe in .NET, is it possible to specify a public key for which the private key is contained only within the Windows CryptoAPI keystore? I see the option for specifying the CSP name, and the container name. Are there…
maxwellb
  • 13,366
  • 2
  • 25
  • 35
4
votes
1 answer

Getting issue with sn.exe running outside the NETFX 4.0 Tools

Did anyone figure out why the .net 4.0 verision of sn.exe crashes if run outside C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\ ? (Using Windows XP, 32-bit) Visual Studio 2010 works just fine, sn works while inside the NETFX 4.0…
stic
  • 1,008
  • 3
  • 10
  • 23
4
votes
2 answers

How to import an .snk file generated with sn.exe in .NET?

I have created a key file with this command: sn.exe -k 2048 Build.snk I would like to read in this key with .NET. I haven't been able to find any document as to the format of the .snk, so I'm wondering if there's a way in C# to read in an .snk…
Steve Wranovsky
  • 5,503
  • 4
  • 34
  • 52
4
votes
1 answer

How to set LARGEADRESSAWARE in no signing assembly projects for a ClickOnce app?

I have an application with the next two Post-Compilation commands: call editbin /LARGEADDRESSAWARE $(TargetPath) call editbin /LARGEADDRESSAWARE $(ProjectDir)obj\$(PlatformName)\$(ConfigurationName)\$(TargetFileName) and works fine. But when I…
2
votes
1 answer

Strong name validation failure on Import-Module

I'm unable to import an assembly, supposedly because strong name validation is failing, though this occurs even when I register the assembly to not be checked. Can somebody spot what I'm doing wrong here? Below is a transcript. For reference, the…
Justin R.
  • 23,435
  • 23
  • 108
  • 157
2
votes
0 answers

Generating keypair and storing in Keystore

I'm currently working on a system based on this article: http://www.codeproject.com/Articles/4940/Using-XML-Digital-Signatures-for-Application-Licen However, in the article he uses sn.exe to generate a keypair and store it into a key container. I'm…
Ben
  • 1,291
  • 2
  • 15
  • 36
1
vote
1 answer

Signing mixed code assembly

I have a mixed assambly written in C++ managed and unmanaged. To sign this assembly I use delayed signing with the following Post-build event: sn -R $(TargetPath) $(ProjectDir)Fischer.snk This works without any problems on my own PC (VS2010…
MTR
  • 1,690
  • 3
  • 20
  • 47
1
vote
0 answers

error MSB3325: Cannot import the following key file, restart issue

I installed the key pair into the key container. I am then able to build. If I restart the computer, then I get the error again. (ResolveKeySource target) -> C:\Program Files (x86)\Microsoft Visual…
Sarah Weinberger
  • 15,041
  • 25
  • 83
  • 130
1
vote
1 answer

How to undo sn.exe -Vr *

I needed to debug EntityFramework to figure out why it didn't accept my connectionstring. And in order to do that I had to use the sn.exe -Vr * command since disabling one or two assemblies didn't work. So now I want to restore everything to…
1
vote
1 answer

Can't get the full public key for 4.0 beta 2 assemblies

I'm having an issue getting the public keys for some of the .net 4.0 beta 2 assemblies so I can make my internals visible to them (gross). Normally, I'd just pop into SN.EXE and poof I'd have them. But instead of getting what I'd normally expect I'm…
user1228
1
2