为什么我不能附上我的程序?

时间:2022-10-11 00:33:34

I can start debugging (F5).

我可以开始调试(F5)。

If I start with Ctrl+F5 and then go to attach later I am unable.

如果我从Ctrl+F5开始,然后在后面附加,我就不能。

The program name is grayed out. The attach button is disabled when I select the row for the program.

程序名是灰色的。当我为程序选择行时,attach按钮被禁用。

I've tried using Attach to "Automatic" or picking Managed 4.0 + Native.

我尝试使用附加到“自动”或选择管理4.0 +本机。

I've tried checking both "Show processes from all users" and "Show processes in all sessions"

我尝试过检查“所有用户的显示过程”和“所有会话中的显示过程”

I'm running Visual Studio as an administrator.

作为管理员,我正在运行Visual Studio。

Any ideas?

什么好主意吗?

2 个解决方案

#1


4  

You are probably seeing the .vshost.exe process for your application, which is always grayed out.

你可能看到了。vshost。应用程序的exe进程,它总是灰色的。

Look through the list of processes and make sure that there isn't another one listed with the same/similar name.

查看过程列表,并确保没有另一个具有相同/类似名称的列表。

Also note: if this is a console application and the process reaches the end of the Main method (the console window will say "Press any key to continue . . ."), then you will probably not see the process listed, because it has ended.

还要注意:如果这是一个控制台应用程序,并且进程到达主方法的末尾(控制台窗口会说“按任意键继续…”),那么您可能不会看到所列出的进程,因为它已经结束了。

#2


0  

If you use the .vshost file for faster start times and you start without debugging you cannot attach because the .vshost process is always debugger bound to the Visual Studio instance.

如果您使用.vshost文件以获得更快的启动时间,并且可以在没有调试的情况下启动,因为.vshost进程总是与Visual Studio实例绑定的调试器。

#1


4  

You are probably seeing the .vshost.exe process for your application, which is always grayed out.

你可能看到了。vshost。应用程序的exe进程,它总是灰色的。

Look through the list of processes and make sure that there isn't another one listed with the same/similar name.

查看过程列表,并确保没有另一个具有相同/类似名称的列表。

Also note: if this is a console application and the process reaches the end of the Main method (the console window will say "Press any key to continue . . ."), then you will probably not see the process listed, because it has ended.

还要注意:如果这是一个控制台应用程序,并且进程到达主方法的末尾(控制台窗口会说“按任意键继续…”),那么您可能不会看到所列出的进程,因为它已经结束了。

#2


0  

If you use the .vshost file for faster start times and you start without debugging you cannot attach because the .vshost process is always debugger bound to the Visual Studio instance.

如果您使用.vshost文件以获得更快的启动时间,并且可以在没有调试的情况下启动,因为.vshost进程总是与Visual Studio实例绑定的调试器。