32

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?

CJM
  • 11,908
  • 20
  • 77
  • 115
Morgan Cheng
  • 73,950
  • 66
  • 171
  • 230
  • 1
    This reared its head again in VS 2017. Projects that didnt have it enabled now popup the host when opening the solution. – StingyJack Jun 03 '17 at 18:54

4 Answers4

43

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'.

aogan
  • 2,241
  • 1
  • 15
  • 24
21

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>
Damian
  • 4,723
  • 2
  • 32
  • 53
  • 1
    This one worked for me, thanks. It seems changing project type from Class Library to Console Application in VS was not enough. – Mert Akcakaya Nov 20 '14 at 09:15
  • 1
    Oh man! I know this is old, but just today I was struggling with this issue on VS2013. This solved it. – elvin Mar 11 '15 at 06:05
  • FYI...just commenting out the **XML element** `ProjectTypeGuids` does not disable the WCF option, you must remove the GUID `{3D9AD99F-2412-4246-B90B-4EAA41C64699}` entirely from the project file. It's best just to remove the XML element `ProjectTypeGuids` from the project all together. – SliverNinja - MSFT Nov 26 '15 at 02:29
4

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>-->
CheGueVerra
  • 7,849
  • 4
  • 37
  • 49
1

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.

CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138