How to debug a C # .NET application in Visual Studio 2010 that starts from another process

I have a .NET GUI application written in C # and a PDF printer. There is a field in the PDF printer where you can set a command to launch an external application.

In this case, I can print a document with this printer, and the printer will start my EXE file with the file path of the generated PDF file as an argument. How can I debug my application when it is started from the printer?

In Visual Studio 2010, I can set debugging information for command line arguments, and this works fine. But if the application starts from the printer, the application does not work properly. So I want to debug my application when it starts from the printer. How can i do this? Is there a parameter for running an exe file in debug mode or something like this?

+5
source share
3 answers

You can connect to the process when it starts using a small registry setting.

Switch to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options

, , myapp.exe. debugger vsjitdebugger.exe.

, EXE , , .

+8

:

http://msdn.microsoft.com/en-us/library/c6wf8e4z.aspx

1. "" " ". , "".

2. " " , .

a. , debug , . . .

b. , .

c. Remote Desktop Connection, Show .

3. "" , , , . , . :

a. .

b. " ", "" .

c. OK.

4. "".

"" . . , . "".

, . "" . . .

. "" Debug. . . .

+9

, . , Win32 , .NET System.Diagnostics.Debugger.Break ( System.Diagnostics.Debugger.Launch).

, , , :

   #if DEBUG
      if (++staticCounter > 3) System.Diagnostics.Debugger.Break();
   #endif

And, of course, you will want to disable it for production.

+1
source

All Articles