Creating Strong Names in .NET Using the Strong Name Tool

After receiving instructions from google, I tried to create StrongNameFile with the following command:

C:\Program Files\Microsoft Visual Studio 9.0\VC\sn -k StrongNameFile.snk 

When I ran the command, I got an error message:

 'sn' is not recognized as an internal or external command, operable program or batch file. 

I tried this as follows:

 C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin>sn -k StrongNameFile.snk 

But the same mistake. Please help me solve this problem.

+4
source share
5 answers

Open a Visual Studio command prompt instead of the usual command prompt. (Start> Microsoft Visual Studio 2008> Visual Studio Tools> Visual Studio Command Prompt.) This will configure PATH to include the .NET Framework SDK directories that include sn.exe .

If you need to manually configure the path for your own scripts or command line, you need a path:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

(The exact version may vary.)

+8
source

You are probably using the DOS command line. In fact, you need the Visual Studio command line when running sn.

+1
source

Use the Visual Studio 2008 command prompt shortcut in the Start menu:

All programs | Microsoft Visual Studio 2008 | Visual Studio Tools | Visual Studio 2008 Command Prompt

In this case, use the "sn" command.

This shortcut sets the environment settings you need.

0
source

As an alternative to all other answers, here you can find your hard drive for sn.exe ...

0
source

this works in the following steps: If you have Visual Studio 2012/2013, open the visual studio command prompt, then go to C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ SDK \ v3.5 \ Bin> then run commands below Create a key file by running the following command: sn -kc: \ pairkey.snk Extract the public key into the file: sn -pc: \ pairkey.snk c: \ pubkey Extract the public key and public key token from the file: sn -tp c : \ pubkey

0
source

All Articles