Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting a program with MSBuild/Web Deployment Project and not waiting for it

Tags:

msbuild

I would like explorer opened up on a certain folder, after the deployment has happened, and I'm using the following to attemp it:

<Target Name="AfterBuild">
  <Exec Command="..."></Exec>
</Target>

However, a simple "explorer \somewhere" causes the build process to block on explorer, and it wont finish until you close explorer. Prefixing it with start explorer \\somewhere doesn't change that either.

Is there a simple way to do this? Thing is that we only deploy to a intermediate stage, and want the last step done manually, and opening an explorer on the relevant folder is a nicety. The Exec command actually calls a BAT file if that matters, using VS.NET 2008, on Server 2008 Standard.

like image 821
Svend Avatar asked Aug 07 '09 17:08

Svend


People also ask

Is it is possible to build application if MSBuild is not installed?

Is it possible to build an application on a system if the MSBuild is not installed? If so, How? Yes, it is actually possible because the MSBuild doesn't depend on the Visual Studio of its operations.

How do I run MSBuild project?

To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.

Can a Visual Studio be complied with MSBuild without opening Visual Studio?

To install MSBuild on a system that doesn't have Visual Studio, go to Build Tools for Visual Studio 2019, or install the . NET SDK. If you have Visual Studio, then you already have MSBuild installed. With Visual Studio 2022, it's installed under the Visual Studio installation folder.

How do I make sure my Web Management Service is started?

Verify that Remote Agent Service or Web Management Service are started on the remote computer, depending on which one you are connecting to. You can do a "net start wmsvc & net start msdepsvc" on the remote computer to ensure these services are started.


1 Answers

What I ended up doing was have a

<Exec Command="..." Timeout="2000"></Exec>

That is, launch Explorer from a different Exec element then the copy-element, and then add a somewhat short timeout on this element. This means VS starts up Explorer, and after 2 seconds, returns.

like image 185
Svend Avatar answered Oct 16 '22 14:10

Svend