如何防止 Visual Studio 在调试时启动 WcfSvcHost.exe?

发布于 2024-07-08 13:59:24 字数 252 浏览 5 评论 0原文

我在 Visual Studio 2008 中有一个解决方案,它有多个项目。 其中一个项目是 WCF 项目。 有时我只想调试其他项目,但当我按 F5 时,Visual Studio 会启动 wcfsvchost.exe 来托管 WCF 项目,即使它不是“启动项目”。

目前,每次调试其他项目时,我都必须卸载 WCF 项目,以防止弹出烦人的 WcfSvcHost.exe 主机。 然而,这并不方便。 有人知道防止 WCF 项目在调试模式下托管的更好主意吗?

I have a solution in Visual Studio 2008 which has multiple projects. One of the projects is a WCF project. Sometimes I just want to debug other projects, but when I press F5, Visual Studio has wcfsvchost.exe launched to host the WCF project even it is not "StartUp Project".

Currently, every time I debugging other projects, I Have to Unload the WCF project to prevent the annoying WcfSvcHost.exe host pop up. However, it is not convenient. Anybody know better idea to prevent WCF project to be hosted in debugging mode?

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

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

发布评论

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

评论(4

熊抱啵儿 2024-07-15 13:59:24

转到 WCF 项目属性页中的“WCF 选项”部分,然后取消选中“在同一解决方案中调试另一个项目时启动 WCF 服务主机”复选框。

Go to WCF Options section in the property page of your WCF project and unselect the check box that says 'Start WCF Service Host when debugging another project in the same solution'.

秋千易 2024-07-15 13:59:24

如果您已经创建了一个WCF项目,然后将其更改为控制台项目,发现WCF服务主机仍在启动,请编辑该项目并编辑ProjectTypeGuids以删除WCF项目类型:

旧:

<ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

新:

<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

If you have created a WCF Project, and then change it to a Console project, and find that the WCF Service Host is still being launched, edit the project and edit the ProjectTypeGuids to remove the WCF Project type:

Old:

<ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

New:

<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
尘世孤行 2024-07-15 13:59:24

您可以尝试卸载解决方案中的WCF项目,然后进行调试。

抱歉,太晚了,我读错了最后一部分,那么我所知道的唯一其他方法就是注释掉项目属性组中的 Web 部件。 这阻止了我弹出窗口

卸载项目,注释掉提到的部分,重新​​加载。

<!--<PublishUrl>http://localhost/WindowsFormsApplication1/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>-->

You could try to unload the WCF project in the solution, then debug.

Sorry it was late I misread the last part to fast, then the only other way, that I know of, is to comment out the web parts in the Property Group of the project. This prevented the pop-up for me

Unload the project, Comment out the mentioned part, reload.

<!--<PublishUrl>http://localhost/WindowsFormsApplication1/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>-->
看海 2024-07-15 13:59:24

不确定这是否可以解决您的问题,但如果您单击解决方案资源管理器中的 WCF 项目,请查看它是否具有“调试时始终启动”属性。 如果是,请将其设置为 false。 不过,该属性仅针对某些项目类型显示,因此它取决于您使用的项目模板的类型。

Not sure if this would fix your issue or not, but if you click on the WCF project in solution explorer, see if it has a "Always Start When Debugging" property. If it does, set it to false. That property only shows up for some project types though, so it depends on exactly what type of project template you used.

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