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, openHKEY_LOCAL_MACHINEFolder.
- NavigateHKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Image File Execution options.
- UnderImage File Execution optionsFolder, 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-clickImage File Execution optionsFolder and chooseNew KeyFrom the shortcut menu.
- Right-click the new key and chooseRenameFrom the shortcut menu.
- Edit the key name to the name of your application, for example,
myapp.exe
.
- Right-clickMyapp.exeFolder and chooseNew String ValueFrom the shortcut menu.
- Right-click the new string value and chooseRenameFrom the shortcut menu.
- Change the name
debugger
.
- Right-click the new string value and chooseModifyFrom the shortcut menu.
TheEdit stringDialog box appears.
- InValue DataBox, type
devenv /debugexe
.
- ClickOK.
- FromRegistryMenu, chooseExit.
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.
NoteIf the application is managed, Visual Studio launches with
Debugger typeSet
Auto. Before you debug, change
Debugger typeFrom
AutoTo
MixedIn
Property pagesDialog Box. For more information, see specifying debugger settings.
See also
Using the debugger