I am trying to sign an assembly with a strong name by following the guide from here: http://msdn.microsoft.com/en-us/library/xc31ft41.aspx
The key instruction is:
al /out:<assembly name> <module name> /keyfile:<file name>
And it says
module name is the name of the code module used to create the assembly
I don't understand what this means. In the literal sense I would interpret the above as some component of csc.exe (i.e., it created the assembly) but obviously this is nonsensical in this context.
So firstly what does this refer to, and secondly (in order to aid my meta-learning) how would one go about reasoning what it is? I get the impression given the terseness of the documentation that it should be obvious or intuitive to me, but it currently is not.
I tried specifying some random names (e.g. blah.blah) but get this error:
ALINK: error AL1047: Error importing file 'c:\path\to\proj\bin\Debug\blah.blah' -- The system cannot find the file specified.
Edit: Upon further reading I get the impression the module name is the name of the code, but I have not had any luck specifying the .cs files either - I am told Database file is corrupt and may not be usable
.
In Solution Explorer, open the shortcut menu for the project, and then choose Properties. Under the Build tab you'll find a Strong naming node. Select the Sign the assembly checkbox, which expands the options. Select the Browse button to choose a Strong name key file path.
A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. It is generated from an assembly file using the corresponding private key.
The AL task wraps AL.exe, a tool that is distributed with the Windows Software Development Kit (SDK). This Assembly Linker tool is used to create an assembly with a manifest from one or more files that are either modules or resource files.
How to sign an assembly in Visual Studio. You sign an application or component by using the Signing tab of the project properties window (right-click the project node in Solution Explorer and select Properties). Select the Signing tab, then select the Sign the assembly check box. Specify a key file.
An assembly is made up of modules (.netmodule files), which are produced by compiling sources (.cs files). The assembly linker is responsible for packaging modules into assemblies. So if you have two source files class1.cs and class2.cs:
csc /t:module class1.cs
csc /t:module class2.cs
al /out:assembly.dll /t:library class1.netmodule class2.netmodule
For the best treatment of how the CLR deals with modules, manifests and assemblies, see Richter.
In VS2010, click on Project Properties -> Signing Tab -> Check Sign this assembly.
Provide or create Strong name key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With