PIRATED 20130914 1701

PIRATED 20130914 1701

NOTE: This content appears to have been plagiarized. Please leave a comment or email tnwiki at Microsoft (with a link to this article) if we are mistaken. The content was pulled from the following source:
The community rules state:
  • "Someone else has relevant content and you want to help them share it with the world. It's a nice thought, but do not copy other people's content to the Wiki, even if the owner said it was OK."



When we create a strong named assembly and want this assembly to be used by someone else, we partially build this assembly by provide a Public Key. We write this Public Key in the AssemblyInfo.vb OR .cs file using the attribute

<assembly:assemblykeyfileattribute("somekey.snk")>
</assembly:assemblykeyfileattribute>

Note here that somekey.snk is a key that you create using sn.exe tool.
We create it like this in the command line compiler

sn.exe -k "c:\somekey.snk"

Note that we also turn off the verification of the assembly (the DLL) using the sn tool like this...
sn -Vr assemblyName.dll where -Vr is an option.
Once created, we add it to the assemblyinfo file.
We also add an attribute by the named
<assembly:assemblydelaysignattribute(true)>

to the assembly info file. This makes it sure that when we build the assembly, It would be containing the information only about the public key before we deliver it to our client or whosoever needs it.
Remember that this is a partial strong named assembly that we have created, and hence we say that it is a Delayed Assembly.
In this process, the public key is inserted into the assembly manisfest, which ultimately reserves some space for the Full Strong Named Assembly in the Portable Executable (PE) file.

In the end, while giving the key to your client, they may use the following command to convert the Delayed Assembly to a Full Strong Named Assembly
sn -R assemblyname.dll strongKey.snk where strongKey.snk is a strongly named key.

Source

This topic was copied from this ASP.net forum reply by moredotnet.
 

Leave a Comment
  • Please add 3 and 4 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Carsten Siemens edited Revision 2. Comment: Pirated Content - see my comment

  • XAML guy edited Revision 1. Comment: added original source

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • XAML guy edited Revision 1. Comment: added original source

  • Carsten Siemens edited Revision 2. Comment: Pirated Content - see my comment

  • NOTE: This article was reported as Pirated/Plagiarized Content (content you didn't write) and will be removed. Please do not steal content from others. If you feel we are mistaken, please leave a comment or email tnwiki at Microsoft with a link to this article and with clear and detailed reasons why you own the content or have explicit permission from the author.

    Content was taken from: forums.asp.net/.../1

Page 1 of 1 (3 items)