Questions regarding assembly

F

fh1996

csc /target:module MyMod.cs

What's meaning of "NETMODULE"?

Is /target:module always going to generate xxx.netmodule?

Does C# compiler only generate the following 3 types of files: .EXE, .DLL
and .NETMODULE?

When should produce .NETMODULE files instead of others?

Is the only use of .NETMODULE files to be added to an assembly?

What's the minimum composition of an assembly? At least a .DLL file or .EXE
file?

Thanks!
 
J

Jon Skeet [C# MVP]

fh1996 said:
csc /target:module MyMod.cs

What's meaning of "NETMODULE"?

It's probably easiest thought of as "part of an assembly".
Is /target:module always going to generate xxx.netmodule?

I believe so.
Does C# compiler only generate the following 3 types of files: .EXE, .DLL
and .NETMODULE?

And .PDB, really.
When should produce .NETMODULE files instead of others?

Very rarely, IME - especially as you can't have multi-code-module
assemblies in VS.NET (2002/2003 at least).
Is the only use of .NETMODULE files to be added to an assembly?

What's the minimum composition of an assembly? At least a .DLL file or .EXE
file?

Yes, IIRC - basically an assembly is a collection of modules, with the
appropriate "main" module (i.e. the one whose filename you specify)
containing a manifest saying which other modules are part of the
assembly. I can't remember what happens if the other modules also have
manifests - you could end up in strange situations, but basically you
wouldn't do that...
 
F

fh1996

Jon Skeet said:
And .PDB, really.

Thanks!

PDB files are not the "end" products but something of debugging info, aren't
they?

Thus, they can't be distributed as part of application or reused by other
projects for development.

Very rarely, IME - especially as you can't have multi-code-module
assemblies in VS.NET (2002/2003 at least).

What's "multi-code-module"? Code written in different languages?
"Very rarely"? Then whenis the appropriate time for doing this?

Yes, IIRC - basically an assembly is a collection of modules, with the
appropriate "main" module (i.e. the one whose filename you specify)
containing a manifest saying which other modules are part of the
assembly.

"main module"? What does this mean?
 
J

Jon Skeet [C# MVP]

fh1996 said:
Thanks!

PDB files are not the "end" products but something of debugging info, aren't
they?
Indeed.

Thus, they can't be distributed as part of application or reused by other
projects for development.

Well, you *might* want to distribute them as part of an app for a
specific customer, to get a more detailed stack trace.

Oh, and the C# compiler can also generate XML documentation.
What's "multi-code-module"? Code written in different languages?
Yup.

"Very rarely"? Then whenis the appropriate time for doing this?

For one thing, if you really need to inclue code written in different
languages in a single assembly. Basically I wouldn't worry about it -
very few people are going to want to use it.
"main module"? What does this mean?

The one with the manifest / the one whose filename you specify. It's
only in that sense that it's the "main" one.
 
G

Grant Richins [MS]

Jon was right on the money but I wanted to clarify a few points:
A .netmodule is really just a .dll with a different file extension and no
assembly manifest.
The output file can have any extension you want to specify via the /out
option
An assembly consists of exactly 1 manifest and as many files as you want
(each file is listed in the manifest). It is illegal to try and create an
assembly with more than one manifest.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top