Alex Rivera | Logout

What is the 'module name' when using al.exe to sign an assembly with a strong name?

Asked 2010-12-07T02:38:11.977
14

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.

Edit
Report

2 Answers

6

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.

answered 2010-12-07T02:54:56.867
2

In VS2010, click on Project Properties -> Signing Tab -> Check Sign this assembly.

Provide or create Strong name key.

answered 2013-01-04T11:27:58.297

Your Answer