当一个控制台应用程序已在运行时,如何在 Visual Studio 中启动第二个控制台应用程序

发布于 2024-08-27 15:17:14 字数 256 浏览 4 评论 0原文

我正在研究 WCF 书中的一些示例。单个解决方案中有一个主机项目和客户端项目。两者都是控制台应用程序。主机是启动应用程序,但客户端应用程序似乎没有像书中所说的那样打开控制台。书上说,当主机运行时,运行客户端。 “运行”按钮已被禁用,因为它已经在运行。书中的示例肯定将它们放在同一个解决方案和 Visual Studio 的单个实例中。无论如何,我在这里缺少什么?我已经用两个 VS 实例完成了此操作,但我确实从未在单个实例中这样做过。任何帮助总是值得赞赏。

干杯, 〜ck在圣地亚哥

I am working through some examples in a WCF book. There is a Host project and Client project within a single solution. Both are console applications. The Host is the startup app, but the Client app doesn't seem to open the Console like the book says. Book says while the Host is running, run the Client. The Run button is disabled tho as it is already running. The book example definitely has them in the same solution and a single instance of Visual Studio. Anyways, what am I missing here? I have done this with two instances of VS, but I truly have never does this in a single instance. Any help is always appreciated.

Cheers,
~ck in San Diego

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你的背包 2024-09-03 15:17:14

您还可以在调试时同时启动两个控制台应用程序。

  • 在解决方案资源管理器中,右键单击该解决方案,然后选择属性
  • 在左侧窗格中,选择通用属性 | 启动项目
  • 然后,在右侧选择多个启动项目
  • 您可以设置启动任意数量的项目 - 带或不带调试。

You can also make both console apps start at once when you debug.

  • In Solution Explorer, right-click the solution, and select Properties.
  • In the left pane, select Common Properties | Startup Project.
  • Then, on the right, select Multiple Startup Projects.
  • You can set any number of your projects to start - with or without debugging.
瀟灑尐姊 2024-09-03 15:17:14

右键单击解决方案资源管理器中的宿主项目,然后转到调试 ->启动新实例。

一旦运行,您可以执行相同的操作来启动客户端项目,或者,如果客户端项目是启动项目,您可以像平常一样按 F5。

Right-Click on the host project in solution explorer then go to debug -> start new instance.

Once it is running you can do the same thing to start the client project, or, you can press F5 like normal if the client project is the startup project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文