How to do a build in the background with command prompt

  • Thread starter Thread starter Zeng
  • Start date Start date
Z

Zeng

Hello,

I'm using C# .NET. Is there a way to do a build my project and solution
with command prompt? I hope that while it's doing that, at least I can
browse around the code instead of being stuck with un-responsive IDE during
build started in IDE.

That would save me lots of time.
Thanks!
 
You can use the command-line compiler (csc.exe), but it can be pretty
complicated to translate all the work the IDE does into the appropriate
command-line arguments.

A simpler solution might be to use a build tool like NANT.
http://nant.sourceforge.net/
I believe they have a "Solution" action (might be part of NantContrib)
that allows you to build your solution by specifying the .sln file -
much simpler than trying to figure it all out for csc.exe.
 
Zeng said:
I'm using C# .NET. Is there a way to do a build my project and solution
with command prompt? I hope that while it's doing that, at least I can
browse around the code instead of being stuck with un-responsive IDE during
build started in IDE.

You can run devenv from a command prompt, eg

devenv MySolution.sln /build Debug

Just be warned that if you change code during a compile, you could end
up with "interesting" results :)
 
I tried it and got build error. It complained that my <project>.dll is being
used, if I build it in IDE doesn't complain if I build in there. Probably
it's being used by the IDE itself. Occasionally I need to attach IDE to the
asp exe to debug. Any idea how to resolve this part? Thanks for your help.
 
Zeng said:
I tried it and got build error. It complained that my <project>.dll is being
used, if I build it in IDE doesn't complain if I build in there.

Ah, right. You won't be able to do that, then :(
Probably
it's being used by the IDE itself. Occasionally I need to attach IDE to the
asp exe to debug. Any idea how to resolve this part? Thanks for your help.

Under Debug, there should be "Attach to process" - find ASPNET (I seem
to remember it being called that, anyway).
 
Probably
Under Debug, there should be "Attach to process" - find ASPNET (I seem
to remember it being called that, anyway).

aspnet_wp.exe on NT/2000/XP
w3p.exe on 2003
 
do you have an example of a full command statement with parameters to make
it work?

Thanks!
 
Back
Top