Home > Sharepoint > How to Sign assembly with strong name

How to Sign assembly with strong name

When you’ve several *.dll that doesn’t have strong name in your Sharepoint Project,

most probably you’ll get caught with Error “Assembly generation failed – Referenced Assembly ‘{dll name}’ does not have strong name.

Then solution is signing assembly with strong name using “ildasm” to diassemble and “ilasm” to re-assemble again using strong name.

Here is the sample how to do it for MYASSEMBLY.dll :

1. Go to Visual Studio Command Prompt

2. Run : ildasm /all /out=MYASSEMBLY.il MYASSEMBLY.dll

3. Run : ilasm /dll /key=key.snk MYASSEMBLY.il

4. Now MYASSEMBLY.dll is already signed with strong name and ready for use in Sharepoint Project.

 

Tips: For signing several *.dll files in current directory, you can use my script below (assuming your key file is key.snk located in current directory):

FOR %i IN (*.dll) DO ildasm /all /out=%~ni.il %I

FOR %i IN (*.dll) DO ilasm /dll /key=key.snk %~ni.il

Categories: Sharepoint Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: