[Home]Strong Name Utility Produces No Output

Contents | (Visit Preferences to set your user name.) | Related To Strong Name Utility Produces No Output | RecentChanges | Preferences | Index | Login | Logout

Featured: Featured Stories | Picture Gallery

Webmaster Resources And Tips | Mariel Hemingway
Google
Chat11.com Web Bible11.com MyBibleCenter.com
Search For Books About:
AssemblyInfo, AssemblyKeyFile, Garnet, PerlNET, SiqlPE, Tech Tips, Tech, Tips
Search The Net:
Garnet
Tech Tips
Tips
Tech
AssemblyInfo
AssemblyKeyFile
PerlNET
SiqlPE
Cover of ISBN 0834003465 Cover of ISBN 0785201688
Cover of ISBN 081297476X The Bush Survival Guide - 250 Ways to Make It Through The NExt Four Years Without Misunderestimating the Dangers Ahead, and Other Subliminable Stategeries
Links:

Silent failure of sn -k produces no output file

Subjects > Tech Tips

Another Garnet Quest! Garnet solves difficult problems for you.... See the bottom of this page for how to let Garnet know if this page helped you.

Microsoft includes with the .NET Framework utility for generating key pairs called the ".NET Framework Strong Name Utility".

This program can be invoked with a command line like:

     sn -k Siqlkey.snk

This is a command to be executed at the DOS prompt. This command will probably not be in your default DOS path. It may live in a location such as

     c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin

However, simply going to that directory to run the utility is not enough. The program may silently fail to produce any output. It might display it's help in response to sn -?, but nothing else will be displayed.

The proper way to run this utility is to use a .NET command window. You get to this special .NET command window by selecting Start | Microsoft Visual Studio.NET 7.0 | Visual Studio.NET Tools | Visual Studio.NET Command Prompt.

You can now run the command to create a .SNK file from that new window.

Other Tips

To use a .snk file in your .net assembly, use include a command like this in the C# AssemblyInfo .cs:

     [assembly: AssemblyKeyFile?Create("..\\..\\Siqlkey.snk")]

Note this path is relative to your object files release directory.

If you don't notice the fact that no .SNK file is produced, and you attempt to compile your application, you might get Compiler Error CS1548.

This is described as:

Upon trying to build your application, you might also see in the task list:

Other related errors you might see

After you generate a correct .snk file, and try to build your application, you might see

   Assembly generation failed -- Referenced assembly 'sampleassembly' does not have a strong name

Highlighting this error in the task list and pressing F1 will take you to Compile Error CS1577 which says that "The assembly-generation part of the compilation failed. See the errors documentation for the alink utility (Al.exe) for more information."

If you look at the Al.exe Tool Errors and Warnings, you'll find that

When adding the AssemblyKeyFile?Create directive to a PerlNET?Create program, it should be done with a fully qualified name such as

   [assembly: System.Reflection.AssemblyKeyFile?Create("Siqlkey.snk")]

Note that PerlNET?Create while PerlNET?Create uses C# semantics, unlike C#, it references the immediate directory.

Another error you might see at runtime is:

What is an .SNK file

The .NET .snk files are encrypted with RSA2, and are binary files, so I can not show you an example of one. If you type an .snk file at the DOS prompt, you'll see the letters RSA2 relatively early in the file, and lots of binary characters. These files are typically 500-600 bytes in size. A recent one I generated is 596 bytes.

Some other searches you might try

None of these really lead directly to a solution, but here are some of the searches I tried before I figured out the above solution:


Time To Track This Down And Describe A Solution: About 2 Hours


See more of Garnet's Tech Tips ...

Did This Page Solve A Difficult Problem For You?

Tech Tips By Garnet ...

If this page helped you, please contact me and let me know.

I spend a lot of time tracking down solutions to many problems and questions, and it takes a lot of time to write about the answers so you can benefit from them. But I hope this page helped you solve your problem, or answered your question, clearly and quickly. If you'd like to support my making more tech tips, please donate a couple of bucks via paypal! For any size donation, I'll send you an Internet Guide on the topic of your choice to include on your website. See [Guides To The Internet] for some examples.

Please also consider making a link to this page from your website.

You can also reach me privately with your questions at [my contact page]!

- Garnet

From Tech Tips


Check out [Facts About Trees]

Search for books about:

AssemblyInfo, AssemblyKeyFile, Garnet, PerlNET, SiqlPE, Tech Tips, Tech, Tips

Search The Net:
Garnet
Tech Tips
Tips
Tech
AssemblyInfo
AssemblyKeyFile
PerlNET
SiqlPE

Contents | (Visit Preferences to set your user name.) | Related To Strong Name Utility Produces No Output | RecentChanges | Preferences | Index | Login | Logout
Edit this www.chat11.com page | View other versions
Last edited March 21, 2008 7:30 pm (diff)
Search:
Sign up for PayPal and start accepting credit card payments
instantly.
Bobsgear - Get A Free Enterrpise Wiki Space!
Review: The Bobsgear Project was started to develop a variety of Confluence plugins. This installation of the Confluence Enterprise wiki includes flexible attachments, many Confluence plugins, personal blogs, interesting articles, and more. Bobsgear already has spaces related to politics, art and photography wiki, technical issues wiki, ediscovery wiki, health, Christian theology and Sabbath School wiki, the bible, book reviews, and quotations. Bobsgear allows free signup, and invites anyone to create a free hosted Confluence wiki space.


NEW USERS CLICK HERE! for a quick introduction to Wiki.

 

 Interested in Books Wanted?
1347 total hits since 10/2007
Recently accessed pages: Ana-Liofa On How The Columbian Cocaine Trade Damages The Young And The Poor Columbian Drug Trade Killing Many More Americans Annually Than Any War Elaine's Book Collection Export Controls Guest Book Application For .NET Using Visual Studio How To Improve Basic Management Skills MageRace North Bay Farmers Markets Seventh-Day Adventist Elder Guide Qualifications Of Elders Seventh-Day Adventist Elder Guide To Small Groups Ministry State Of Connecticut Stretching FAQ 4.1.1 - General Warm-Up Title That You Want Goes Here Wasa Wireless Doorbell World

Elapsed:1