For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > March 2005 > How to do a build in the background with command prompt









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to do a build in the background with command prompt
Zeng

2005-03-22, 3:58 am

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!




Joshua Flanagan

2005-03-22, 3:58 am

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 wrote:
> 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!
>
>
>
>

Jon Skeet [C# MVP]

2005-03-22, 3:58 am

Zeng <Zeng5000@hotmail.com> wrote:
> 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 :)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Zeng

2005-03-22, 8:59 pm

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.



"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1ca9d3351bb1482c98beb3@msnews.microsoft.com...
> Zeng <Zeng5000@hotmail.com> wrote:
during[color=darkred]
>
> 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 :)
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Jon Skeet [C# MVP]

2005-03-22, 8:59 pm

Zeng <Zeng5000@hotmail.com> wrote:
> 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).

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Joshua Flanagan

2005-03-25, 3:58 am

>>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
Zeng

2005-03-31, 4:01 pm

do you have an example of a full command statement with parameters to make
it work?

Thanks!

"Joshua Flanagan" <josh@msnews.com> wrote in message
news:uG6E4BOMFHA.3540@tk2msftngp13.phx.gbl...
the[color=darkred]
help.[color=darkred]
>
> aspnet_wp.exe on NT/2000/XP
> w3p.exe on 2003



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com