How can I give an assembly a valid strong name


S

steve bull

When I run FXCop(1.32) against my project I keep getting the error "Assemblies should have strong names" and cannot get rid of the
message.

I edited the assembly info :

[assembly: AssemblyTitle("Tiler")]
[assembly: AssemblyDescription("Test Program")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Joe Software")]
[assembly: AssemblyProduct("TestProgram")]
[assembly: AssemblyCopyright("(c) 2005 Joe Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyName("")]


I have created a key pair using sn.exe -k and signed the assembly under the Signing tab on the Project Properties page.

I have absolutely no idea what I am doing wrong. The FX help page mentions adding the /keyfile and /keycontainer compiler options. I
am using Visual C# 2005 Express at the moment and can find nowhere to add the options.

It would be nice to get rid of this message.

Any help would be very welcome.


Thanks,
Steve
 
Ad

Advertisements

R

Richard Blewett [DevelopMentor]

steve bull said:
When I run FXCop(1.32) against my project I keep getting the error
"Assemblies should have strong names" and cannot get rid of the
message.

I edited the assembly info :

[assembly: AssemblyTitle("Tiler")]
[assembly: AssemblyDescription("Test Program")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Joe Software")]
[assembly: AssemblyProduct("TestProgram")]
[assembly: AssemblyCopyright("(c) 2005 Joe Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyName("")]


I have created a key pair using sn.exe -k and signed the assembly under
the Signing tab on the Project Properties page.

I have absolutely no idea what I am doing wrong. The FX help page mentions
adding the /keyfile and /keycontainer compiler options. I
am using Visual C# 2005 Express at the moment and can find nowhere to add
the options.

It would be nice to get rid of this message.

Any help would be very welcome.


Thanks,
Steve

Sounds to me like you are using the version for 1.1 not for 2.0. You used to
sign an assembly using the AssemblyKeyFile attribute. Under 2.0 you sign
using the /keyfile command line switch (which is what the signing tab does).

FXCop is probably looking for the attribute and finding that its not set.
Unfortunately I can't see a version of FXCop for version 2.0 RTM on the
homepage

http://www.gotdotnet.com/team/fxcop/

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Re
 
Ad

Advertisements

S

steve bull

Thanks, I will keep an eye out for a new version.

Steve



steve bull said:
When I run FXCop(1.32) against my project I keep getting the error
"Assemblies should have strong names" and cannot get rid of the
message.

I edited the assembly info :

[assembly: AssemblyTitle("Tiler")]
[assembly: AssemblyDescription("Test Program")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Joe Software")]
[assembly: AssemblyProduct("TestProgram")]
[assembly: AssemblyCopyright("(c) 2005 Joe Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyName("")]


I have created a key pair using sn.exe -k and signed the assembly under
the Signing tab on the Project Properties page.

I have absolutely no idea what I am doing wrong. The FX help page mentions
adding the /keyfile and /keycontainer compiler options. I
am using Visual C# 2005 Express at the moment and can find nowhere to add
the options.

It would be nice to get rid of this message.

Any help would be very welcome.


Thanks,
Steve

Sounds to me like you are using the version for 1.1 not for 2.0. You used to
sign an assembly using the AssemblyKeyFile attribute. Under 2.0 you sign
using the /keyfile command line switch (which is what the signing tab does).

FXCop is probably looking for the attribute and finding that its not set.
Unfortunately I can't see a version of FXCop for version 2.0 RTM on the
homepage

http://www.gotdotnet.com/team/fxcop/

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Re
 

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