Signing an assembly referenced in a Visual Studio project

Found this tool which can sign unssigned assemblies in batches.
Seems to have worked ok on a local copy of CheshireCC.Services
Here is some information, but I got stuck trying to find the “module name”, as mentioned in the MSDN help.
Here are some of the steps.First, you need to create a Public/Private Key Pair.Choose >Start, >Programs, >Microsoft Visual Studio 2005, >Visual Studio Tools, >Visual Studio 2005 Command Prompt.Enter the following at the command prompt and then press Enter…
sn -k C:\Temp\sgKey.snkNow the key pair is created.Next, sign the assembly, (for example  “MyAssembly.dll”), with a strong name using the key file, (for example “sgKey.snk”).At that point, MSDN, says… “At the command prompt, type the following command:
al /out:<assembly name> <module name> /keyfile:<file name>
In this command, assembly name is the name of the assembly to sign with a strong name, module name is the name of the code module used to create the assembly, and file name is the name of the container or file that contains the key pair.”What is NOT clear to me is where one gets the “module name”. Where does that come from if one is only starting with a singe file, MyAssembly.dll??? I want to type something like this…
al /out:”c:\Temp\MyAssembly.dll” MyModule.netmodule /keyfile:”c:\Temp\sgKey.snk”
…but the file MyModule.netmodule does not exist. What gets used for “module name” when one starts with a single file???
If you are attempting to sign a third party assembly (dll) follow these steps….

How to assign a strong name to a pre-existing DLL by using following command on visual studio command prompt.

E.g. Lets say the name of the third party DLL is myTest.dll.
Step 1: Dis-assemble the assembly
        ildasm myTest.dll /

Step 2: Re-Assemble using your strong-name key
        ilasm /res:myTest.res /dll /key:myTest.snk /out:myTestSN.dll
This code work perfectly to assign strong name.

for verification you can use following command,
sn -vf myTestSN.dll


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s