Welcome to MSDN Blogs Sign in | Join | Help

Disabling the Visual Studio Service Host

When debugging a WCF project in Visual Studio the WCF Service Host starts up to host my service. How do I stop this from happening so that I can use my own service host?

One of the new tools in Orcas is the WCF Service Host that allows you to automatically host and test a service that you've implemented. The WCF Service Host comes along with some of the specialized WCF project templates in Visual Studio, such as WCF Service Library and Syndication Service Library.

If you've picked one of these project templates, then I don't know of a good way of disabling the service host. This should be fixed in SP1 by adding some user interface to toggle the service host on and off. In the meantime, you can perform some surgery on the project file to work around this. If you look inside the actual csproj file for your project, then you'll see a PropertyGroup section that defines the project.

  <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3CC71D2E-7EC2-46B5-B985-F889B65E3DCD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WcfServiceLibrary1</RootNamespace>
<AssemblyName>WcfServiceLibrary1</AssemblyName>
<ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<StartArguments>/client:"WcfTestClient.exe"</StartArguments>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>

The ProjectTypeGuids list is what controls these special features of projects. Removing the {3D9AD99F-2412-4246-B90B-4EAA41C64699} entry from the list will disable automatic service hosting.

Next time: Debugging Type Loading

Published Monday, May 12, 2008 5:00 AM by Nicholas Allen
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Monday, May 12, 2008 8:22 AM by barryd

# re: Disabling the Visual Studio Service Host

Or you could take the quick and dirty route; rename the app.config file in the project - no more service host, and it's easy to swap back should you need it again.

Monday, May 12, 2008 12:22 PM by Nicholas Allen's Indigo Blog

# Setting the Configuration Name

What's the difference between the Name and ConfigurationName on service contracts and behaviors? The

Tuesday, May 13, 2008 4:29 AM by Zuker On Foundations

# Disabling the Visual Studio Service Host

Via this post . If you haven&#39;t experienced it yet, there&#39;s a project template for WCF in VS2008

Tuesday, May 13, 2008 2:48 PM by Dotmad (on .Net)

# Disabling the WCF Service Host (WcfSvcHost.exe)

One of the new and very annoying feature of Visual Studio 2008 is the WCF service host : Windows Communication

Friday, May 16, 2008 8:07 AM by Visual Studio Hacks

# Visual Studio Links #28

My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. Microsoft Downloads: Visual Studio Team System 2008 Capabilities White Papers . Symbols Package for Windows XP Service Pack 3 . Via

Friday, May 16, 2008 8:06 PM by Code Monkey Labs

# Weekly Web Nuggets #12

General Disabling the Visual Studio Service Host : A new feature in Visual Studio 2008 is the WCF service host - similar to the web development server, but for WCF services. At times, this is handy...all other times, it's obnoxious. Nicholas Allen has

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker