Friday, July 24, 2009

Failed to convert key to token - The public key for assembly '(null)' was invalid when running the sn command to know the publickeytoken of an asembly

ERROR: When trying to know the Public key token fo the strong assembly using sn command you may receive an error as below:
Failed to convert key to token -- The public key for assembly '(null)' was inval id.

SOLUTION: This error comes because the command options are case sensitive. The option Tp is case sensitive.
C:\Program Files\Microsoft Visual Studio 9.0\VC>sn -Tp \PendingTaskReport.dll

6 comments:

  1. Thank you so much for this tip, i was banging my head against the wall for a while.

    ReplyDelete
  2. Yep same here - why can't microsoft give better error messages.

    ReplyDelete
  3. >why can't microsoft give better error messages.

    This is by design.

    ReplyDelete
  4. Another satisfied customer. Thanks for keeping me from banging my head agains a wall :-)

    ReplyDelete
  5. Thanks a lot Anil... :)

    ReplyDelete