How to create an asynchronous build event in Visual Studio (2008)?

你。 提交于 2019-12-03 16:22:26

This might be a bit round-about, but using Windows power-shell to start the process seems to work. I set the post build event to something like this:

powershell start-process <actual-command-line-to-run>

In this case, Visual Studio regains control immediately, without waiting for the started process to complete.

I was having some problems with the powershell method due to spaces in the path I was using, instead I decided to go with a vbscript post build event like this

Tests.vbs """$(DevEnvDir)mstest.exe"""

Then vbscript like this to launch the command async

'args
mstest = WScript.Arguments(0)     'mstest path
Set WshShell = WScript.CreateObject("WScript.Shell")   'Create Windows Shell Object
WshShell.Run "Tests.bat """ & mstest & """", 0, false   'Run Async
Set WshShell = Nothing
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!