[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

Cicada Hunt | Web Style Commentary
Google
Chat11.com Web Bible11.com MyBibleCenter.com
Search For Books About:
AssemblyInfo, AssemblyKeyFile, Garnet, PerlNET, SiqlPE, Tech Tips, Tech
Search The Net:
Garnet
Tech 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 Solve Your Problem?

Tech Tips By Garnet ...

If so, I'd like to hear from you.

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. You can also contact me about your tech problems. If you can afford some donation to cover my time to look into your problem, please mention the amount you can contribute, and that will help me give proper priority to your request.

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]


Contents | (Visit Preferences to set your user name.) | Related To Strong Name Utility Produces No Output | RecentChanges | Preferences | Index | Login | Logout
Edit this bookstore.mybiblecenter.com page | View other versions
Last edited March 21, 2008 6: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 How Companies Try To Eliminate Liability For Operating Pyramid Schemes?
5646 total hits since 10/2007
Recently accessed pages: About Rita Acceptance Pattern Cicada Season Coal-Gas In Dwellings Homepages/Zxc Illinois Search Jennifer Lopez Joanne Woodward Lynn Woolsey August 2005 Open Letter Major Pay Per Click Search Engines MegaFoods More Space Exploration Quotes 3 Search Engine News/BottomAd1 Search Engine News/TopAd1 Stretching FAQ C.6 - Hip Stretching FAQ Disclaimer Stretching FAQ Index Stretching FAQ Introduction Stretching FAQ Part 4 SubmarineByTomClancy Temporary Restraing Order Against Morgenstern Valve

Elapsed:0