After getting the instruction from google, I've 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 comm开发者_开发问答and, I got an error message:
'sn' is not recognized as an internal or external command, operable program or batch file.
I tried it in the following way:
C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin>sn -k StrongNameFile.snk
But got the same error. Please somebody help me to solve this problem.
Open a Visual Studio Command Prompt instead of a normal command prompt. (Start > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio Command Prompt.) This will set up your PATH to include the .NET Framework SDK directories, which include sn.exe
.
If you need to set up the path manually for your own scripts or command prompts, the path you need is:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
(Exact version number may vary.)
You're probably using a DOS command prompt. You actually want a Visual Studio Command Prompt when executing sn.
Use the Visual Studio 2008 Command Prompt shortcut in your Start menu:
All Programs | Microsoft Visual Studio 2008 | Visual Studio Tools | Visual Studio 2008 Command Prompt.
In that, use command "sn".
That shortcut sets up the path environment vars you need.
As an alternative to all the other answers here, you could have searched your hard disk for sn.exe...
this works in below steps: If you have Visual Studio 2012/2013, open the command prompt of visual studio then browse to the path C:\Program Files (x86)\Microsoft Visual Studio 12.0\SDK\v3.5\Bin> then run below commands Create the key file by running this command: sn -k c:\pairkey.snk Extract the public key to file: sn -p c:\pairkey.snk c:\pubkey Extract public key and public key token from file: sn -tp c:\pubkey
Step 1: Developer Command Prompt for visual studio by searching on start menu.
Step 2:C:\Windows\system32> it will come on command promt.
Step 3:chnage the directory on your wish .You can give your solution directory like .cd D:\Learning\Projects\Biztalk\EAISchemas
Step 4: In command prompt, from the folder where you want to store the key file, type the following command, and ENTER:
sn /k file_name .snk
Example: sn /k ErrorHandlingProcess.snk
The above Step can be followed for any Visual Studio Solution
精彩评论