Ask a questionAsk a question
 

AnswerDisabling WcfSvcHost when self-hosting

  • Thursday, January 03, 2008 10:42 PMzachman80 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello everyone,

     

    I'm self-hosting my WCF service in my WCF client.  Because of this I do not need WcfSvcHost to automatically host my service library project when debugging.  Is it possible to conveniently disable the automatic hosting feature?  The only way I've discovered thus far is to unload the service library project and reference the DLL directly instead of using a project reference.

     

    Thanks,

    Zach

Answers

  • Wednesday, February 27, 2008 10:05 PMLorenz Prem Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    You can work around this by removing {3D9AD99F-2412-4246-B90B-4EAA41C64699}; from the <ProjectTypeGuids> in your project file.

     

    Orcas SP1 will add a checkbox in the settings to do this.

     

All Replies

  • Sunday, January 06, 2008 10:50 PMScott Seely Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Looking at VS2008, I've noticed that if I go to Project-->Options-->Debug and let the environment startup the default environment, I get the behavior you describe. If I pick "Start External Program" and pick a new app, then I don't see the behavior you describe. Consider picking a different startup project or EXE, such as your self-host EXE.

     

  • Monday, January 07, 2008 8:26 PMzachman80 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have chosen my self-host EXE as my startup project.  It still starts the WcfSvcHost automatically - I think because the self-host EXE project references the WCF service DLL project.  This also still happens if I remove the project reference and reference the DLL output directly.
  • Wednesday, February 27, 2008 10:05 PMLorenz Prem Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    You can work around this by removing {3D9AD99F-2412-4246-B90B-4EAA41C64699}; from the <ProjectTypeGuids> in your project file.

     

    Orcas SP1 will add a checkbox in the settings to do this.

     

  • Saturday, May 31, 2008 2:07 PMPeter De Jonghe Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Zach,

     

    The solution that worked for me in VS.Net 2008 was to remove the automatically created App.Config file from the WCF Service Library (or, maybe better, rename App.Config to App.Config.xxx). This stopped WcfSvcHost from launching.

     

    CU

     

    Peter

     

  • Friday, September 11, 2009 12:20 AMRichard_G Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You stop auto launch of the Service host by going to the WCF options of the service project (under properties) and disable the auto launch when debugging another project option there. Hope this helps