質問

I have set post build command line, that will run a console application(C#). VS runs the application as it should but I want to see that console application window. Looks like VS create process with no window, so I tried to use

 [DllImport("user32.dll")]
 static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

but it doesnt work too.

Edit: (Added command line)

"C:\AfterBuild.exe" "arg" "$(TargetDir)"

役に立ちましたか?

解決

You can use the 'Start' command in order to launch a new console and run your commands.

For example, create a batch file like this, save it as test.bat:

@echo This is a test.

Now run start with this file as a parameter:

start test.bat

The batch file will run on a new console window.

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true

他のヒント

In case someone wants the command window to be left open after the build process runs:

cd "$(SolutionDir)MYPROJECTNAME\$(OutDir)\$(ConfigurationName)"

start cmd /k MYPROJECTNAME.exe

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top