tags:

views:

94

answers:

3
+1  Q: 

MsBuild never end

<Target Name="RunWebServer">
<Exec Command='$(WebServer) /port:3811 /path:$(Path)' />        
</Target>

command is actually this command:

"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 (R) 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.

script never end. How can is run it and then automatically stop it and prepeare for next Task?

+1  A: 

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.

Nick Craver
Nick Craver thx for your link and help
senzacionale
now i get Invalid switch: Build started 15.5.2010 14:45:07.Project "D:\PROJEKTI\eMedicine\eMedicine\Build.xml" on node 0 (RunWebServer target(s)). Invalid switch - "/port:3811".Done Building Project "D:\PROJEKTI\eMedicine\eMedicine\Build.xml" (RunWebServer target(s)).
senzacionale
@senzacionale - It might be a quoting error in your paths (due to paces), try this `<Exec Command='start /B "$(WebServer)" /port:3811 /path:"$(Path)"' />`
Nick Craver
A: 

becouse of Invalid switch i try now like

<Exec Command='start /B $(WebServer) "/"port:3811 "/"path:$(Path)' /> 

but i get The system cannot find the file /port:3811. If i run without start /B works but never end again

senzacionale
+1  A: 

Please check out AsyncExec,

http://blog.eleutian.com/2007/03/01/AsyncExecMsBuildTask.aspx

It should resolve this problem.

Lex Li
thx this is the solution
senzacionale