none
'sn' is not recognized as an internal or external command

    Question

  • Hi,

    During compilation, the post build event has a script to test sign my assembly. Apparently, the VS 2008 IDE throws a warning that "'sn' is not recognized as an internal or external command".

    I have checked the environment vairables for VS and also ran the vsvars32.dll from the common7\tools directory but of no help.

    Please help!

    Thanks,
    Jeev
    • Moved by Roahn Luo Wednesday, September 16, 2009 12:18 PM not a Visual Studio Debugger issue. (From:Visual Studio Debugger)
    Tuesday, September 15, 2009 12:16 PM

Answers

  • You need to setup environment vairables for VS in your post build commands. If you need help on that, post to the MSBuild forum if your compiler is based on msbuild, or post to the Visual C++ language forum if you are using the VC compiler.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    • Marked as answer by jeev Thursday, October 15, 2009 9:35 AM
    Wednesday, September 16, 2009 4:42 PM
    Moderator
  • What you said was right Sheng! But fortunately the variables were all set. Then I realised that in the specified path C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools the sn.exe itself was missing. I added this and things started to work like charm!

    Thanks anyways for your response!
    • Marked as answer by jeev Thursday, October 15, 2009 9:35 AM
    Thursday, October 15, 2009 9:35 AM

All replies

  • You need to setup environment vairables for VS in your post build commands. If you need help on that, post to the MSBuild forum if your compiler is based on msbuild, or post to the Visual C++ language forum if you are using the VC compiler.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    • Marked as answer by jeev Thursday, October 15, 2009 9:35 AM
    Wednesday, September 16, 2009 4:42 PM
    Moderator
  • What you said was right Sheng! But fortunately the variables were all set. Then I realised that in the specified path C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools the sn.exe itself was missing. I added this and things started to work like charm!

    Thanks anyways for your response!
    • Marked as answer by jeev Thursday, October 15, 2009 9:35 AM
    Thursday, October 15, 2009 9:35 AM
  • Locate where your sn is before running command prompt. Then place that path in the command prompt prior to your code.

    This is how your command prompt should look.

    c:\Program Files\Microsoft Visual Studio 9.0\VC>sn -k "C:\GACKey\GACkey.snk"

    Monday, August 13, 2012 2:21 PM