Strong naming

J

John

Hi

I have a class project which generates a dll which I would like to install
in the gac. When I build the project, I get the following error;

Unable to build assembly XXX into the Global Assembly Cache; the assembly is
not strongly named.

What do I need to do to get the assembly strongly named?

Thanks

Regards
 
M

Mike Labosh

What do I need to do to get the assembly strongly named?

Any assembly that you want to put into the GAC is required to have a "Strong
Name". Here's how to do it:


In your Visual Studio .NET -> Tools program group launch a Visual Studio
..NET 2003 Command Prompt. Then do this to see the command syntax:

sn /?

To generate a Strong Name Key, do this:

sn -k MyAssemblyName.snk

Then put that file in your project directory (where your source code is)

Then open up your project's AssemblyInfo file and add this:

<Assembly:AssemblyKeyFileAttribute("MyAssemblyName.snk")>

(You may have to monkey around with the relative path of the filename inside
the attribute.)

In MSDN Library, goto the index tab and goto "strong-named assemblies"
--
Peace & happy computing,

Mike Labosh, MCSD

"Mr. McKittrick, after very careful consideration, I have
come to the conclusion that this new system SUCKS."
-- General Barringer, "War Games"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top