Search

WCF Service Host is started when debugging WCF project irrelevant of project settings by CoolDadTx

Resolved
as Postponed Help for as Postponed

1
0
Sign in
to vote
Type: Bug
ID: 552716
Opened: 4/20/2010 9:38:33 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
I created a WCF Service Library (attached). I then modified the project to be a console application and removed all options to start the WCF host. Yet every time I begin debugging the WCF Service Host starts anyway and my main program never does.
Details (expand)

Product Language

English

Visual Studio Version

Visual Studio 2010

Operating System

Windows 7

Operating System Language

English

Steps to Reproduce

Attached is a project that replicates the issue.
1) Open the project.
2) Build the code and then debug.
3) The WCF Service Host starts even though the project is configured to be a console application, specifies the startup object and disables hosting options.

The steps to create the original project were:
1) Create a new WCF Service Library.
2) Change the project type to Console Application.
3) On Debug tab remove the command line options.
4) On the WCF Hosting tab uncheck the option to start the WCF Service Host
5) Add the App.cs file from the attached project to the new project.

Actual Results

The WCF Service Host starts whenever the debugger does irrelevant of project settings. The entry point configured for the app is never called.

Expected Results

If the WCF Service Host option is not enabled then the service host shouldn't start. The entry point for the app should start executing when the debugger runs.
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey.

 

File Attachments
File Name Submitted By Submitted On File Size  
WcfServiceLibrary1.zip 4/20/2010 4 KB
Sign in to post a comment.
Posted by Microsoft on 5/4/2010 at 5:51 PM
Hi,

Thank you for your feedback. As a work-around for this issue, please remove the guid "{3D9AD99F-2412-4246-B90B-4EAA41C64699};" from the following line in your WcfServiceLibrary1.csproj file:

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

You could also simply create your service in a console app (this is what is normally done for self-hosted scenarios).

With regard to why your approach was not working:

1. Changing the "Output Type" to "Console Application" simply results in the project getting built into an "exe" instead of a "dll". It is not the same as selecting File->New Project->Console App" (for example, it does not change the ProjectTypeGuids in the csproj file).

2. Unchecking "Start WCF Service Host when debugging another project in the same solution" under "Properties->WCF Options" does not disable the WCF Service Host when debugging the project in which the service is defined. This setting is merely for convenience for when you have multiple projects in the same solution; in this case, debugging any of them would cause the WCF Test Host to start.

Thank you for communicating to us that it was confusing figure out how to correctly set-up a self-hosted service given the current set of WCF templates.

I will pass your feedback along to the feature team for consideration in our next release.

Thanks,
Avner May, WCF
Posted by Microsoft on 4/20/2010 at 11:21 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you
Sign in to post a workaround.