首页 > 代码库 > Launching the Debugger Automatically
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,
myapp.exe
.
- 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
debugger
. - 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
devenv /debugexe
. - 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.
See Also
Using the Debugger
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。