Groups | Blog | Home
all groups > dotnet security > may 2006 >

dotnet security : Signing Assemblies - How To?



Robert W.
5/29/2006 10:44:02 AM
I'm trying to sign my Visual Studio 2003 C#.net WinForms app. I'm following
this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/strongNames.asp

I've generated the public and public/private key files. Then I added the
appropriate lines in 'AssemblyInfo.cs':

[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("..\\..\\..\\publickey.snk")]

I put these lines into my main EXE, plus two DLLs it references. One of
them compiles fine but the other one references
"OpenNETCF.Desktop.Communication", which is a 3rd party DLL.

In this latter case, I'm receiving this error:

Assembly generation failed -- Referenced assembly
'OpenNETCF.Desktop.Communication' does not have a strong name


Since I don't produce this file, how do I give it a strong name?


--
Robert W.
Vancouver, BC
www.mwtech.com
Robert W.
5/29/2006 11:51:02 AM
Henning,

Thanks for your feedback. I actually was able to correctly sign
OpenNETCF.Desktop.Communication using the advice found here:
http://andrewconnell.com/blog/archive/2004/12/15/772.aspx

But now I seem to be getting signing errors with regard to DLLs like
System.Drawing. Surely these system libraries don't each need to be
individually signed too ... do they?

--
Robert W.
Vancouver, BC
www.mwtech.com



[quoted text, click to view]
Robert W.
5/29/2006 1:19:02 PM
It said that System.Drawing had the wrong key for my app, or something to
that effect. I'm giving up on signing for now but will revisit in the
future, perhaps using VS 2005.

--
Robert W.
Vancouver, BC
www.mwtech.com



[quoted text, click to view]
Henning Krause [MVP - Exchange]
5/29/2006 8:29:21 PM
Hello,

in case of the OpenNetCf, you can't... you must get the source and compile
it yourself. The OpenNetCF source is available, AFAIK.

Are you sure you want to do the actual signing process later? This ist what
your AssemblyDelaySign(true) implies. If you just want to sign your code,
set it to false.

Greetings,
Henning Krause

[quoted text, click to view]
Henning Krause [MVP - Exchange]
5/29/2006 9:18:58 PM
Hello,

[quoted text, click to view]

What errors are you getting?

The .NET Framework is already signed, so no, you don't need to sign them
each.

Best regards,
Henning
AddThis Social Bookmark Button