views:

190

answers:

5

Hi all, After getting the instruction from google, I was creating StrongNameFile thru this path C:\Program Files\Microsoft Visual Studio 9.0\VC\sn -k StrongNameFile.snk while i am running the above command, getting error message like... 'sn' is not recognized as an internal or external command, operable program or batch file.

I tried it in following way also.. C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin>sn -k StrongNameFile.snk Here aslo got the same error.

Pls somebody help me to solve this problem.

Thanks, Kumar

+1  A: 

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.)

itowlson
Hi itowlson,I am using Visual Studio Express Edition 2008, there i cant find the command prompt from tools menu....Pls tell me in Express Edition 2008 where can i find this command prompt???
Kumar
Hmm, sorry, I don't have access to Express Edition. But if you are using VS, you don't need to run sn -k: just go to Project > Properties > Signing tab, check the "Sign the assembly" check box, and select "New..." in the drop-down box. Or if you really need the command-line utility, and if Express doesn't give you the `Microsoft SDKs` path I mentioned, you can download the Windows SDK from http://msdn.microsoft.com/en-nz/windows/bb980924%28en-us%29.aspx?wt.svl=more_downloads (you only need the .NET Framework bits).
itowlson
A: 

You're probably using a DOS command prompt. You actually want a Visual Studio Command Prompt when executing sn.

CSharper
A: 

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.

cori
A: 

As an alternative to all the other answers here, you could have searched your hard disk for sn.exe...

pyrochild