|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Launching the Debugger Automatically
You can set up your application to start Visual Studio when you launch the application from Windows. Visual Studio will load your application, ready for debugging, but will not commence debugging until you issue an execution command. Having Visual Studio launch the debugger in this way is useful for debugging services and COM out-of-proc servers.
To setup an application to launch the debugger automatically
- Start the Registry Editor (regedit).
- In the Registry Editor, open the HKEY_LOCAL_MACHINE folder.
- Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\currentversion\image file execution options.
- Under the Image File Execution Options folder, locate the name of the application you want to debug (myapp.exe, for example). If you cannot find the application you want to debug:
- Right-click the Image File Execution Options folder and choose New Key from the shortcut menu.
- Right-click the new key and choose Rename from the shortcut menu.
- Edit the key name to the name of your application, for example,
- Right-click the myapp.exe folder and choose New String Value from the shortcut menu.
- Right-click the new string value and choose Rename from the shortcut menu.
- Change the name to
- Right-click the new string value and choose Modify from the shortcut menu.
The Edit String dialog box appears.
- In the Value data box, type
- Click OK.
- From the Registry menu, choose Exit.
The directory containing devenv.exe must be in your system path.
Now, use any method to start your application. Visual Studio .NET will start and load the application.
Note If the application is managed, Visual Studio launches with the Debugger Type set to Auto. Before you debug, change the Debugger Type from Auto to Mixed in the Property Pages dialog box. For more information, see Specifying Debugger Settings.