Compile Questions

G

Guest

I am trying to teach myself how to compile my application at the command line
with the csc.exe. I found a good article which steps you through the
process, but I have some questions, which I hope someone can elighten me
on....

1. In VS2005, I found an article about how VS2005 is using a new tool
called "MSBuild" to do compiles. Does this mean that csc.exe is being
replaced and I really should be learning this new tool?

2. Strong Names - The example showed you how to use a utility to create a
"strong name" and utilize this as a compile option. What does this do for
me? It seems that the /keyFile would not accept a path which was on another
drive, maybe I did something wrong, but I had to move the .snk file into the
same directory where I was doing the compile. I was compiling from the c:
prompt, but all my code and references were on another drive.

3. I'm confused as to when to create a ".netModule" or a ".dll" file. Why
would I create one vs. the other.

Thanks in advance for your assistance!!
 
N

Nicholas Paldino [.NET/C# MVP]

See inline:
1. In VS2005, I found an article about how VS2005 is using a new tool
called "MSBuild" to do compiles. Does this mean that csc.exe is being
replaced and I really should be learning this new tool?

MSBuild is a build system, not the actual program that performs the
compilations. csc.exe is still the executable which does the actual
compilation. With MSBuild, you have project files (xml based) which have
items (various files and types) which are then processed by tasks (there is
a CSC task which does compilation for C#). There is much more to this, but
that's a high-level overview. The MSBuild engine will take the project
items, pass them to the CSC task, which will create the command line for
running csc.exe, etc, etc.
2. Strong Names - The example showed you how to use a utility to create a
"strong name" and utilize this as a compile option. What does this do for
me? It seems that the /keyFile would not accept a path which was on
another
drive, maybe I did something wrong, but I had to move the .snk file into
the
same directory where I was doing the compile. I was compiling from the c:
prompt, but all my code and references were on another drive.

You should use a full path for the /keyFile switch. A strong name key
allows you to create strong named assemblies. You can find a good
description of strong-named assemblies here:

http://msdn2.microsoft.com/en-us/library/wd40t7ad.aspx
3. I'm confused as to when to create a ".netModule" or a ".dll" file.
Why
would I create one vs. the other.

An assembly is a set of 1-N netmodules. Netmodules have code and
implementation in them, but no manifest. An assembly has a manifest which
details the contents of the assembly and subsequent netmodules. An
advantage of a netmodule is that you can create netmodules in various
languages (perhaps leveraging the benefits of one language in one module and
another language in another module) and then combine them into one assembly.

Hope this helps.
 

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