How can I stop Visual Studio running all my web services
Asked Answered
A

6

22

How to stop Visual Studio 2008 from automatically running my web services.

I have a large Visual Studio 2008 solution that contains a number of web app projects and also several wcf web services. I have set the solution to have only one startup project, yet when I right-click on the web app project and select "Debug" > "Start New Instance" there appear multiple WebDev.WebServer icons in the system tray. There is one for every web service in the project.

Note: My web app project does have one Web Reference, but not to any of the WCF web services that are being launched.

I want to be able to stop these un-wanted web services from running.

Adnah answered 11/9, 2009 at 8:11 Comment(0)
A
49

Eureka!

  1. Click on the web service project.
  2. Look at the "Properties" tab/window (Ctrl+W, P). For a web service you will see a property called "Always Start When Debugging" (which of course is set to True by default). NOTE: This is on the property sheet, not the property dialog for the project.
  3. Set "Always Start When Debugging" = False for all the un-wanted web apps/ web services.

My solution builds and starts really quick now!

Adnah answered 11/9, 2009 at 8:34 Comment(4)
that was what i was trying to find (even though i had no webservice available).Hepatica
Awesome. This was driving me crazy. It was launching even when I was just attaching a debugger.Crusted
very tricky! ,, why they don't have this option under the property dialog! i was looking for such option all over the place,, bad design :(Textbook
Awesome! This has been killing me - how are they gonna set that by default and not put that on the debug properties?! Some PM knew he was quitting as soon as this shipped this!Beading
O
4

This isn't ideal, but I generally just right-click->unload them until I need them. They are still available in the solution (to reload on demand), but it avoids this launch niggle, and releases some resources (and makes "build solution" quicker etc).

Omnipresent answered 11/9, 2009 at 8:23 Comment(0)
H
1

Try right clicking on your SOLUTION.

Common Properties -> Startup Project -> Single Startup Project (and selecting the website only).

try that?

Hepatica answered 11/9, 2009 at 8:16 Comment(1)
I have checked Solution > Properties > Set Startup Projects - there is only one project set to start (the WebApp one).Adnah
G
1

Not a direct answer, but why do you keep those projects in 1 solution?

If you break it up you solve your problem and you could have multiple instances of VS2008 running to work on those Apps and Services simultaneously.

Gerundive answered 11/9, 2009 at 8:22 Comment(0)
H
1

I think there have been some updates to VS 2010 since this was originally answered. The way I'm doing this is to:

1) Right click the WCF project and go to 'Properties'

2) Select the tab for 'WCF Options'

3) Uncheck the box that says 'Start WCF Service Host when debugging another project in the same solution'

Headon answered 12/6, 2017 at 22:38 Comment(0)
O
0

Are there any project dependencies set between your project and the WCF projects? That might cause VS to think it needs to get them all started before running your main project.

Oenone answered 11/9, 2009 at 8:15 Comment(1)
No, there are no project dependencies between my Web App project and the WCF web service projects.Adnah

© 2022 - 2024 — McMap. All rights reserved.