MSBuild never ends
<Target Name="RunWebServer">
<Exec Command='$(WebServer) /port:3811 /path:$(Path)' />
</Target>
The above command actually translates to the one given below:
"C:\Program Files (x86)\Common Files\microsoft shared\DevServer\9.0"\WebDev.WebServer /port:3811 /path:"D:\PROJEKTI\eMedicine\eMedicine\eMedicine"
But when I start build.xml
D:\PROJEKTI\eMedicine\eMedicine>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MsBuild.exe Build.xml /target:RunWebServer
Microsoft (开发者_如何学JAVAR) Build Engine Version 3.5.30729.4926
[Microsoft .NET Framework, Version 2.0.50727.4927]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 15.5.2010 14:06:36.
the script never ends. How can I run it and then automatically stop it and thereby prepare for next task?
Please check out AsyncExec,
http://blog.eleutian.com/2007/03/01/AsyncExecMsBuildTask.aspx
It should resolve this problem.
You need to alter it slightly to not wait on the web server to die, like this
<Exec Command='start /B $(WebServer) /port:3811 /path:$(Path)' />
I'm not sure exactly why you're starting a Web Server as part of the build, but the default behavior is going to be MSBuild waiting for the WebDev.WebServer.exe
to exit/close. You can read more about how START
works here and here. It basically kicks it off as a separate process, not one it waits on.
精彩评论