简体   繁体   English

在VS2010附加到进程对话框中禁用进程

[英]Process is disabled in VS2010 attach to process dialog

I have a VS2010 running on a WTS machine (Windows2008). 我在WTS机器上运行VS2010(Windows2008)。 I'm trying to attach the debugger into a process. 我正在尝试将调试器附加到进程中。 The process is running a WPF client. 该进程正在运行WPF客户端。 The process is presented in the attach to process dialog, but grayed out and the attach button is disabled. 该过程显示在“附加到进程”对话框中,但显示为灰色,并且禁用了“附加”按钮。

I read through the discussions, and confirmed managed code is enabled for debugger, with no luck. 我仔细阅读了讨论,并确认托管代码已启用调试器,没有运气。 Here are two screenshots representing the current situation (in the first image, the process I'm trying to debug is marked in blue - please note I'm running as admin): 以下是两个代表当前情况的屏幕截图(在第一张图片中,我正在尝试调试的过程标记为蓝色 - 请注意我以管理员身份运行):

snapshot goes here - but was removed by stack overflow... 快照在这里 - 但被堆栈溢出删除了...

After trying the automatic code type selection, I tried the manual way, with no luck. 在尝试自动代码类型选择后,我尝试了手动方式,没有运气。 Here is the screenshot: 这是截图:

snapshot goes here - but was removed by stack overflow... 快照在这里 - 但被堆栈溢出删除了...

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks, Busi 谢谢,布斯

Perhaps you are already attached to the process? 也许你已经加入了这个过程? Did start debugging before attaching to the process? 在连接到流程之前是否开始调试?

Found another cause/solution to this problem, select the 'Show processes from all users' and 'Show processes in all sessions' check boxes and I got two instances of my service, one greyed out (which was always visible) and another I could attach to. 找到了解决此问题的另一个原因/解决方案,选择“显示所有用户的进程”和“在所有会话中显示进程”复选框,我有两个服务实例,一个灰色(总是可见),另一个我可以附上。 hth :). hth :)。

I ran into the same issue with my windows service. 我的Windows服务遇到了同样的问题。 I could not attach to a running windows service that I built. 我无法附加到我构建的正在运行的Windows服务。 My solution has multiple projects with the windows service as the startup project. 我的解决方案有多个项目,Windows服务作为启动项目。

I found out that my problem is caused by having the startup project is the same as the windows service. 我发现我的问题是由启动项目与Windows服务相同引起的。

To solve my problem, I just set a different project as the StartUp Project. 为了解决我的问题,我只是将一个不同的项目设置为StartUp Project。

I'm not certain, but there may be a debugger already attached to the process, and that's why Visual Studio won't let you attach it. 我不确定,但可能已经有一个调试器附加到该进程,这就是Visual Studio不允许您附加它的原因。 Are you certain that you're not running the application already in debug mode or do you have another VS instance running? 您确定您没有在调试模式下运行应用程序,或者您是否正在运行另一个VS实例?

If you are trying to attach a web service or web app (w3wp.exe) then, try resetting the iis (iisreset). 如果您尝试附加Web服务或Web应用程序(w3wp.exe),请尝试重置iis(iisreset)。 It worked for me. 它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM