Strong Name Utility Produces No Output
| |
| The Bush Survival Guide - 250 Ways to Make It Through The NExt Four Years Without Misunderestimating the Dangers Ahead, and Other Subliminable Stategeries |
|
Links:
| |
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.
[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:
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:
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
Check out [Facts About Trees]
|
Interested in How Companies Try To Eliminate Liability For Operating Pyramid Schemes?