http://msdn.microsoft.com/en-us/library/a329t4ed(vs.71).aspx
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.
自动启动调试器
本文介绍如何设置应用程序以在从Windows启动时自动启动Visual Studio进行调试。通过修改注册表中的特定键值,可以在不立即开始调试的情况下加载应用程序,适用于调试服务和COM外进程服务器。
6490

被折叠的 条评论
为什么被折叠?



