How do you see the compiler command line in c#?

B

billben74

Despite advances in devstudio .NET building large projects can still be
difficult.
Is there a way, perhaps using EnvDev class or some other class that
would allow output of the "command line" that is being used to compile
a C# project. This would be very useful as one could
explicitly see which assemblies were being included in each project; it
would also be a good starting point to complete custom complex builds
via command line difficult in the IDE.
Thanks very much for any help.
Ben Dobson
Software Engineer
Beacon-ct.co.uk
 
G

Guest

Take a look at
http://msdn.microsoft.com/library/d...ry/en-us/cscomp/html/vcrefCompilerOptions.asp
for some info on what you can do with the current C# compiler.

For reference too, be sure to look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/csharpcompiler.asp
which gives a very in depth look at the C# 2.0 compiler (the version that
comes with VS2005 & Framework 2.0 SDK). While not the same version as the
current, much of what it describes is still applicable.

Brendan
 
B

billben74

Thank you very much for taking the time to reply to my post. The
referances are certainly very helpful for working just with the command
line compiler.

What Im also after, however, is to see the command line that dev studio
produces when it compiles a solution.
This is because I (well my colleges and I) have had some problems with
large solutions being difficult to build on different machines.
I have read various microsoft articles on working in a team, issues
such as the copy local option for dlls etc. However the bottom line is
that if I could see an explicit compliler command line, like the one
you see in off the linker section in project properties in C++ I should
be able to track down which dll/reference incompatability is causing
the issue with a difficult build.

Thank you to anyone who chips in (and thanks again to Brendan).
 
N

Nicholas Paldino [.NET/C# MVP]

Ben,

AFAIK, this isn't possible with VS.NET 2003. You would have to use
something like NAnt (a build system) or something if you want to do this.
However, the problem there is that the integration between NAnt and VS.NET
2003 isn't there.

In VS.NET 2005, this is possible however. The build system that VS.NET
2005 uses for VS.NET projects is MSBUILD, which is a new build platform for
..NET. The project files themselves are what is used to drive MSBUILD, and
you can provide those same project files to the command-line version of
MSBUILD.

Hope this helps.
 
B

billben74

Thank you very much Nicholas,

I will take a look at NAnt and see what it can do.

One still is left wondering how NAnt does stuff(which I may soon find
out buy reading its literature/source code), or if some of those COM
objects for automating dev studio wouldn't be able to help out.
But I'll turn my antension to NAnt.
Thanks again Nicholas for being so helpful.

Ben Dobson
Software Engineer
Beacon-ct.co.uk
 
N

Nicholas Paldino [.NET/C# MVP]

Ben,

Honestly, if you can make the move to VS.NET 2005 (it is in it's second
beta now, and will be released in November, I believe), then do that, since
MSBUILD will be the better option (the integration into VS.NET alone is
priceless).
 
B

billben74

Hi Nicholas,

I don't disagree, just been having a look at the lovely command line
output in 2005. (It does of course beg the question why wasn't this
included before but....)
However at my place we deliver source code (and sometimes maintain
other people's source code) for clients as well as writing our own so
the platform isn't always up to us - mores the pity.

But thank you; believe me this and many other things - at last real
type safty through C++ like templates, smalltalk-like anonymous
functions (i didn't see them coming but I can't wait to use them) . ASP
stuff that works like it should and some real C++ integration (thanks
Herb Sutter).

You are preaching to the converted, the MSBUILD being just another
reason. But clients will be clients.
Thanks again Nicholas,
Ben Dobson
 

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