Disabling Visual Studio Development Server - Any way to do this per project?
Asked Answered
F

4

10

When debugging my website project I usually go to start options in the web project's properties and select 'Don't open a page' and 'Use custom server' with a url that's in my host file pointing to my local IIS.

Even when I do this though visual studio still spawns it's own Development Server instance every time I hit f5.

Is there any way to disable this?

Also for web application projects that have shared ascx files for instance Visual Studio will also launch an instance of Development Server each time I debug the solutions for each for these projects. This results in a million instances of Development Server running on my machine at any given moment.

Is there any way to disable development server for a given project completely? Without pointing it to a localhost sub application?

Flotilla answered 12/8, 2010 at 17:41 Comment(0)
W
1

When I create a website project, I prefer to host the site on IIS, mostly because it is easier to run the IIS application pools under a service account, is more flexible with authentication options, and is more like production (when compared to Cassini).

Unlike the Web Application Project, a website gives no built-in support for "adding itself" to your local IIS. If you already have a filesystem-based website project, what I usually do is:

  1. Remove the website project from my solution.
  2. Configure the application/virtual folder in IIS to use the filesystem-based website I just removed.
  3. Right click on my solution and select Add Existing Web Site.
  4. Choose "Local IIS", instead of "File System", and pick my site from the list of applications.

Besides the fact that it is manual, it makes for smooth debugging without the development server, and TFS is sufficiently aware of the file system that it manages my source code correctly

I hope this helps.

Wattle answered 17/8, 2010 at 1:52 Comment(2)
Yea I suppose this may be the only solution to having a million cassini instances all the time. The reason I'd prefer not to use localhost for my web projects is two fold: 1. The web project that interface with the user directly is almost always expecting to live in root. 2. The project's that aren't directly navigated to with a browser don't need to be run independently. Since all my projects are in team foundation server and I'd like any new user to be able to pull a project down and run it cassini seems to be the most flexible of the host config choices.Flotilla
Requiring a localhost/appname creation is relatively invasive to require for any developer touching the system. Plus that config precludes the application from running in root. Requiring every user to create a new IIS site for the app isn't super easy either. What I want is for any developer to be able to take the project down from source control and run it. Cassini seems to be able to serve this purpose for the most part. I just wish I couldn't turn it off entirely for some projects or disable it for when I choose 'use custom server', cassini always seem to want to spawn a server instance.Flotilla
F
5

I've just solved the same thing by doing the following

  1. Select the project
  2. Right click->Properties->Web Tab
  3. From the Start Action, select Dont open a page
  4. From Web Server select Use Custom Web Server, specify http://127.0.0.1 as start page
Fonteyn answered 7/2, 2011 at 14:33 Comment(0)
E
2

Click on Project, Properties, Web. Under Servers,select Use Local IIS Web Server. If the site has not been created on IIS yet, click on Create Virual Directory. Your project will now run in IIS when you debug.

Electra answered 13/8, 2010 at 7:36 Comment(1)
Any way to do this on a website project? I think this only refers to web application project types.Flotilla
W
1

When I create a website project, I prefer to host the site on IIS, mostly because it is easier to run the IIS application pools under a service account, is more flexible with authentication options, and is more like production (when compared to Cassini).

Unlike the Web Application Project, a website gives no built-in support for "adding itself" to your local IIS. If you already have a filesystem-based website project, what I usually do is:

  1. Remove the website project from my solution.
  2. Configure the application/virtual folder in IIS to use the filesystem-based website I just removed.
  3. Right click on my solution and select Add Existing Web Site.
  4. Choose "Local IIS", instead of "File System", and pick my site from the list of applications.

Besides the fact that it is manual, it makes for smooth debugging without the development server, and TFS is sufficiently aware of the file system that it manages my source code correctly

I hope this helps.

Wattle answered 17/8, 2010 at 1:52 Comment(2)
Yea I suppose this may be the only solution to having a million cassini instances all the time. The reason I'd prefer not to use localhost for my web projects is two fold: 1. The web project that interface with the user directly is almost always expecting to live in root. 2. The project's that aren't directly navigated to with a browser don't need to be run independently. Since all my projects are in team foundation server and I'd like any new user to be able to pull a project down and run it cassini seems to be the most flexible of the host config choices.Flotilla
Requiring a localhost/appname creation is relatively invasive to require for any developer touching the system. Plus that config precludes the application from running in root. Requiring every user to create a new IIS site for the app isn't super easy either. What I want is for any developer to be able to take the project down from source control and run it. Cassini seems to be able to serve this purpose for the most part. I just wish I couldn't turn it off entirely for some projects or disable it for when I choose 'use custom server', cassini always seem to want to spawn a server instance.Flotilla
A
0

I recently faced this issue with a WCF project. Didn't want to use IIS (as the service was self-hosted). Didn't want to go for a workaround of 'Don't open a page', etc.

Found the solution in answer to Prevent Visual Studio 2010 from starting ASP.net development server.

Worked perfectly fine for me.

Ansermet answered 22/7, 2015 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.