Saturday, April 23, 2005
by Nik Kalyani
Saturday, April 23, 2005 5:31:40 PM (Pacific Standard Time, UTC-08:00)

If you wish to create strong named assemblies in .Net, you need to sign them. This is done using a key that you reference through the project’s AssemblyInfo.cs or AssemblyInfo.vb file. There are three attributes related to signing:

[assembly: AssemblyDelaySign(false)] Used to allow signing of the assembly with only the public key. This allows the assembly to be used during development without having to share the private key.

[assembly: AssemblyKeyFile("")] Used to specify the path to a key file.

[assembly: AssemblyKeyName("")] Used to specify the name of a key to use from the Crypto Service Provider (CSP).

If you are going to sign all your assemblies, then the AssemblyKeyName is the best option as it does not require you to remember a path to the key file each time you create a new project. It’s much easier to remember a simple name associated with the key. Here’s how you would sign an assembly using the CSP:

1) Generate a key pair:  sn -k MyCompany.snk

2) Install into the CSP:  sn -i MyCompany.snk MYCOMPANY

3) Use in your code:  [assembly: AssemblyKeyName(“MYCOMPANY”)]

#    Comments [2] - Trackback    

ASP.Net

Tracked by:
"phentermine" (phentermine) [Trackback]
Tuesday, November 22, 2005 10:42:18 PM (Pacific Standard Time, UTC-08:00)
True friends are the people that are there for you unconditionally. They are the people that never question you and support you no matter what the circumstances are. They are the people worth living for.
Tuesday, November 22, 2005 10:58:55 PM (Pacific Standard Time, UTC-08:00)
Friendship is the hardest thing in the world to explain. It's not something you learn in school. But if you haven't learned the meaning of friendship, you really haven't learned anything.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, i, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
RSS feed
Search and Links
Bling

View Nik Kalyani's profile on LinkedIn

Contact me: nik*kalyani.com (replace "*")

TechBubble
www.flickr.com
This is a Flickr badge showing public photos from techbubble. Make your own badge here.
Statistics
Total Posts: 204
This Year: 22
This Month: 0
This Week: 0
Comments: 231
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Nik Kalyani
Sign In
All Content © 2008, Nik Kalyani