views:

79

answers:

1

I am trying to do a poor man integration with xUnit.Net from inside Visual Studio as a post build event.

What I want is when I press Shift+F6 (Build the test project), after a successful build it should run xUnit.Console.exe and output the result in an html file and afterward launch the html file inside the browser.

Below is what I got so far and it work, but not to my liking (in that the browser will appear as a modal dialog of sort and I can't switch back and forward / toggle (using Alt-Tab) between Visual Studio and the browser. Right now I must close the browser for VS to gain focus again which kind of sucks.

My Post Build event below:

"$(SolutionDir)\Components\xUnit.net\xunit.console.exe" "$(TargetPath)" /html "$(TargetDir)result.htm"
"$(TargetDir)result.htm"

Any idea on how to get it so result.htm is displayed inside a browser and not in a modal mode?

After further test, it seems that any shell / command executed ran in modal mode. For example, I tried simple cmd.exe to pop up a Command shell.

I tried using start C:\Windows\IE7\iexplore.exe "$(TargetDir)result.htm" but that didn't work either...

+1  A: 

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.

Tarydon
Cool, I'll check it out.
Jimmy Chandra