简体   繁体   English

在Visual Studio中调试从另一个调用的应用程序?

[英]Debugging an application called from another in Visual Studio?

I have a lobby application which invokes a client-application (think: League of Legends). 我有一个大厅应用程序,它调用客户端应用程序(想想:英雄联盟)。 They're two separate applications and the first invokes the second from itself - how can I get Visual Studio to debug this application as well? 它们是两个独立的应用程序,第一个从自身调用第二个应用程序 - 如何让Visual Studio调试此应用程序?

You simply need to launch a separate Visual Studio, and then use Debug | 您只需要启动一个单独的Visual Studio,然后使用Debug | Attach to Process to attach to the other process. 附加到Process以附加到其他进程。 The trick is using two Visual Studios. 诀窍是使用两个Visual Studios。

Debug -> Attach to process 调试 - >附加到进程

Select the executable from the list. 从列表中选择可执行文件。

Make sure to select the right code type with the Select.. button. 确保使用Select ..按钮选择正确的代码类型。

Have you tried Debug -> Attach to Process ? 您是否尝试过Debug -> Attach to Process

Ref: http://msdn.microsoft.com/en-gb/library/vstudio/3s68z0b3.aspx 参考: http//msdn.microsoft.com/en-gb/library/vstudio/3s68z0b3.aspx

Like Matthew said Debug|Attach to process. 就像Matthew所说的Debug | Attach to process。 If the other application is in a different service you might also want to look into remote debugging 如果其他应用程序位于不同的服务中,您可能还需要查看远程调试

The other answers are correct, but I just wanted to add another approach: 其他答案是正确的,但我只想添加另一种方法:

If you add both projects to a single Visual Studio Solution, you could: 如果将两个项目添加到单个Visual Studio解决方案,则可以:

Right-click the solution -> Properties -> Common Properties -> Startup Project

There you would select Multiple startup projects and select both the Lobby and the Client applications. 在那里,您将选择Multiple startup projects并选择Lobby和Client应用程序。

That way you can debug several VS projects without having to run several VS instances. 这样,您可以调试多个VS项目,而无需运行多个VS实例。

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

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