Visual Studio的Just-In-Time Debugger窗口出现在随机select的RDP Session中

在安装了远程桌面服务并且有多个用户login的Windows Server 2008 R2服务器上,Visual Studio实时debugging器窗口可能出现在任何RDP会话中,而不一定是其操作导致错误的会话。

使用传统的VB6 COM对象和SQL Server数据库的传统ASP应用程序中出现错误。 似乎w3wp.exe进程中的错误不知道哪个RDP用户的浏览器会话启动了导致错误的操作,因此它随机select一个RDP会话来产生JIT Debugger窗口。 当显示对话框时,传统的ASP应用程序冻结给每个人,无论他们在哪个RDP会话或者他们是否远程访问应用程序。 更糟糕的是,窗口往往出现用户的活动窗口下。 为了摆脱这种情况,必须要求机器上每个有RDP会话的人去查找JIT Debugger窗口并取消它。

有没有办法强制JITdebugging器窗口出现在特定用户的RDP会话中 – 最好是希望debugging进程的用户的会话?

由于它位于terminal服务器和生产服务器上,请卸载Visual Studio。

JITdebugging器在安装Visual Studio时安装它自己。

我强烈build议使用本地计算机来满足您的编码需求,因为JIT 需要一个控制台窗口

启用或禁用即时debugging

您可以从“选项”对话框中启用或禁用实时debugging。 启用或禁用实时debugging

 On the Tools menu, click Options. In the Options dialog box, select the Debugging folder. In the Debugging folder, select the Just-In-Time page. In the Enable Just-In-Time debugging of these types of code box, select or clear the relevant program types: Managed, Native, or 

脚本。

 To disable Just-In-Time debugging, once it has been enabled, you must be running with Administrator privileges. Enabling Just-In-Time 

debugging将设置registry项,并且需要pipe理员权限才能更改该项。

 Click OK. 

默认情况下,Windows窗体应用程序有一个顶级的exception处理程序,允许程序在可以恢复的情况下继续运行。 因此,您必须执行以下附加步骤来启用Windows窗体应用程序的即时debugging。 启用Windows窗体的即时debugging

 Set the jitDebugging value to true in the in the system.windows.form section of the machine.config or 

application.exe.config文件:

 <configuration> <system.windows.forms jitDebugging="true" /> </configuration> In a C++ Windows Form application, you must also set DebuggableAttribute in a .config file or in your code. If you compile 

用/ Zi和不用/ Og,编译器为你设置这个属性。 如果你想debugging一个非优化的版本,那么你必须自己设置它。 您可以通过将以下行添加到您的应用程序的AssemblyInfo.cpp文件中执行此操作:

 [assembly:System::Diagnostics::DebuggableAttribute(true, true)]; For more information, see DebuggableAttribute. 

即使Visual Studio不再安装在您的计算机上,即时debugging仍可能启用。 如果未安装Visual Studio,则无法禁用“Visual Studio选项”对话框中的即时debugging。 在这种情况下,您可以通过编辑Windowsregistry来禁用即时debugging。 通过编辑registry来禁用即时debugging

 In the Start menu, click Run. In the Run dialog box, type regedit, then click OK. In the Registry Editor window, locate and delete the follow registry keys: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger If your computer is running a 64-bit operating system, delete the following registry keys also: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger Take care not to accidentally delete or change any other registry keys. Close the Registy Editor window. 

即时debugging错误

您可能会看到与Just-In-Timedebugging相关的以下错误消息。

 An unhandled win32 exception occurred in <program>. Just-In-Time debugging this exception failed with the following error: The logged 

在用户没有权限debugging崩溃的应用程序。

 This message indicates that Just-In-Time debugging failed because you do not have proper access permissions. For information on the 

所需的权限,请参阅[已过时]远程debugging权限。

 Unable to attach to the crashing process. The specified program is not a Windows or MS-DOS program. This error occurs when you try to attach to a process running as another user under Windows 2000. To work around this problem, start Visual Studio, open the Attach to Process dialog box from the Debug menu, and find the process you 

要在“可用进程”列表中进行debugging。 如果您不知道进程的名称,请查看Visual Studio Just-In-Time Debugger对话框,并记下进程ID。 在“可用进程”列表中select进程,然后单击“附加”。 在“Visual Studio即时debugging器”对话框中,单击否解除对话框。

 Debugger could not be started because no user is logged on. This error occurs when Just-In-Time debugging tries to start Visual Studio on a machine where there is no user logged onto the 

安慰。 因为没有用户login,所以没有用户会话来显示实时debugging对话框。

 To fix this problem, log onto the machine. Class not registered. This error indicates that the debugger tried to create a COM class that is not registered, probably due to an installation problem. To fix this problem, use the setup disk to reinstall or repair your Visual Studio installation. 

来自: https : //msdn.microsoft.com/library/5hs4b7a6%28v=vs.100%29.aspx