How to get Post-Build Event to launch GUI app, still edit.

G

Guest

I'm trying to launch a code coverage tool as part of the post build event for
a special debug configuration. It launches just fine, but Visual Studio is
busy waiting for the post build to finish before it allows any modifications
to take place. I would like to be able to work back and forth between
modifying the unit test and looking at the coverage information.

I have tried putting the Start command inside the batch as well as. It
works fine if I run the batch file outside of Visual studio but doesn't help
if inside.

Any help appreciated.
 
N

Nicholas Paldino [.NET/C# MVP]

Dave,

Personally, I think that MSBUILD is doing the right thing here. If you
want to get around this, you will have to create a new task which you use to
launch your code coverage too, one that will not wait for the program to
complete in order to proceed.
 
H

Hugh Magoo

I figured out how to launch a program at Post build and not cause Visual Studio to wait for it.

You have to create a stub launcher app. The stub launcher app runs your command that you eventually want to run. It doesn't work with batch files, cmd files, "start", etc.

Here is the entirety of the code in my stub launcher that works to launch and return immediately, without hanging up Visual Studio:



class Program
{
/* the reason for this stub is so that we can launch the post build target without blocking Visual Studio's build progress */

static void Main(string[] args)
{
Process spawnProcess = new Process();
spawnProcess.StartInfo.FileName = "C:\\some_path\\some_file.exe";
spawnProcess.StartInfo.UseShellExecute = true;
spawnProcess.Start();
}
}




DaveHarri wrote:

How to get Post-Build Event to launch GUI app, still edit.
26-Jun-07

I'm trying to launch a code coverage tool as part of the post build event for
a special debug configuration. It launches just fine, but Visual Studio is
busy waiting for the post build to finish before it allows any modifications
to take place. I would like to be able to work back and forth between
modifying the unit test and looking at the coverage information

I have tried putting the Start command inside the batch as well as. It
works fine if I run the batch file outside of Visual studio but doesn't help
if inside

Any help appreciated.

Previous Posts In This Thread:

How to get Post-Build Event to launch GUI app, still edit.
I'm trying to launch a code coverage tool as part of the post build event for
a special debug configuration. It launches just fine, but Visual Studio is
busy waiting for the post build to finish before it allows any modifications
to take place. I would like to be able to work back and forth between
modifying the unit test and looking at the coverage information

I have tried putting the Start command inside the batch as well as. It
works fine if I run the batch file outside of Visual studio but doesn't help
if inside

Any help appreciated.

Re: How to get Post-Build Event to launch GUI app, still edit.
Dave

Personally, I think that MSBUILD is doing the right thing here. If you
want to get around this, you will have to create a new task which you use to
launch your code coverage too, one that will not wait for the program to
complete in order to proceed

--
- Nicholas Paldino [.NET/C# MVP
- (e-mail address removed)


EggHeadCafe - Software Developer Portal of Choice
Silverlight Deployed To SharePoint With Active Directory
http://www.eggheadcafe.com/tutorial...0-a705f7bed500/silverlight-deployed-to-s.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top