I have a solution with a few projects in it, one of which is a web site. When I run one of the non-web projects (e.g. a console app), the ASP.NET Development Server starts up anyway.
I'm sure there was an option for this somewhere - how do I make the ASP.NET Development Server start only if I am running the web project?
Yes, if you select the project, there is a start when debugging option (or similarly named) in the project properties window in VS; setting this to false disables this.
HTH.
Related
I am debugging a large web application solution, with the main web application project as a single startup project, configured to use IIS for debugging. Whenever I run this application inside Visual Studio 2010, I still get multiple instances (sometimes over 15) of the ASP.NET Development Server starting up as well. Why does this occur?
Visual Studio has a setting in every Web Project's properties by default to start the development server when you are debugging. This enables, for example, a web project which contains Web Services to be available when you've selected a client web site or application to start.
If you do not want this behaviour follow these steps:
Select the web project
Open the "Properties" window by pressing F4
Change the Always Start When Debugging value to False
Repeat steps 1-3 for any other web projects in your solution
Source: '"Always Start When Debugging" – Preventing multiple Visual Studio Development Servers from starting' by by Kevin Rintoul
A simple solution if you have many web projects in the same solution: from the Package Manager console:
get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = $False} }
This will change all web projects Always Start When Debugging setting to false with a single command.
My setup is similar to yours (except I use CassiniDev ( http://cassinidev.codeplex.com/ ))
Go to all your secondary sites project properties : click "use Custom Web Server", set something in "Server Url" (for exemple http://your-iis-server:your_port/your_project, but it may be even invalid)..
This will prevent the automatic startup of Cassini for the secondary web sites.
Leave your main site in the original configuration.
I have two projects in my solution
1- asp.net web project.
2- wcf serivce project.
3- other common projects between two listed above
Current on the local dev machine I have to run two visual studio instance to run both projects in debug mode. That makes the system run out of resources as these projects share some other project in the soultion which are heavy in files.
Is there a way i can hookup the wcf project on a sinlge visual stodio instance and also be able to debug my asp.net web project. ?
I do not want to combine the web and wcf project in to one. Have already considred this option.
thanks for sharing your thoughts in advance.
You can.
Set your web project to use iis.
Use attach to process menu option to select two processes - w3 and service.
Sources for Both processes that you attach to has be in your solution.
Actually you can attach to more than two, in my project i sometimes debug two wcf services and webapplication and js in IE as well
Add all the projects in the same solution, set the client (the asp.net app) as the startup project, hit run... you'll be able to debug through from the client to the service and back again.
Hi guys,
We have a mixed development environment of three servers running: Win Server 2003 & 2008, IIS 7 & IIS 6, ASP.NET 2.0 & ASP.NET 3.5. Previously, all three servers were Server 03/IIS6/ASP.NET 2.0, but with this new change, I am finding that pushing/moving any applications from server to server is always a terrifying experience because there are always a variety of problems with the web.config from server to server. I used to consider myself a confident ASP.NET developer but now I am frightened to come to work every day.
I have always used the web.configs that VS generates for me on the Win 2003/ ASP.NET 2.0 server. None of our web.configs are "leet", they are just normal, although we do use ScriptManager and UpdatePanel.
To get by, as a temporary fix, I'm having to remember that when projects are moved/tested/deployed, never to move or overwrite any web.configs and things get confusing very fast. I've tried "ducttaping" like suggested here my web.configs with the new IIS7 stuff but even that doesn't work all the time.
What can I do here, what's going on? Is there a standard web.config that will work on all of the servers and do the UpdatePanel and ScriptManager ?
[edited question]
Since IIS6 is the baseline install for your application, you should make sure to run the application in "Classic" mode under IIS7. This makes configuration the same as an IIS6 box. This is how we run our web applications for now until we have fully migrated to 100% IIS7 server environments and we have zero problems with deployment/runtime.
To do this you can either choose to run your app under the built in "Classic .NET AppPool" that comes with IIS7 or, assuming you create your own custom application pools, just make sure you set the "Managed Pipeline Mode" to "Classic" under the "Advanced Settings" dialog for the app pool.
You should seriously look at web deployment projects for visual studio 2008.
This is an official add-on for Visual Studio that gives you a new project type called web deployment project. Among the most useful features is the ability to do web.config search/replace as well as pre-compiled builds of your web sites or web application projects.
In your case, what you'd do is create a solution configuration in visual studio for all of your target web servers. Then you'd create a web deployment project for your web app. In the properties for the deployment project you tell it how you want to compile the project and what web.config replacements you want to use for each solution configuration.
The end result should be that you can open Visual Studio, pick a solution configuration, build the deployment project. The build will create a folder with everything you need for that environment including the correctly configured web.config files. Then you just copy the folder to your server and you are up-and-running.
Best of all, since the different config files are all stored in the projecct, it lets you manage your configuration in one place and check it all into source control.
Do note that there is no equivalent in Visual Studio 2010. Instead, VS 2010 has a whole new deployment mechanism called MSDeploy. With 2010 you don't need a seperate project for deployments, and MSDeploy goes a lot further allowing you to package your SQL databases and other stuff too.
You can use the Classic mode under IIS6 by changing the process. That is actually pretty simple and it should work.
Another approach would be to automating your deployment process and have it so that it deploys the correct web.config to the server when you need to update your application.
If you run your IIS 7 websites using the Classic .NET App Pool, then the config files will match what you would use for IIS 6. That's probably the easiest thing to do until you're ready to migrate everything to IIS 7.
Knowledge is a great way to get over fear. Figure out what's going on (you're currently grasping at straws) and the fear will go away.
It's my guess that you'll do better if you refactor the code that uses the config file. Sloppiness there can definitely explain your weirdness and inconsistencies. You can't control much with your config settings if the code isn't behaving properly.
I have a solution file containing multiple web applications and components. Mostly these web applications operate independently of one another, but I need to be able to response.redirect from one application to another. This works, and the new page runs, but I can't step into the code in the second web app and debug it.
I have both web applications set to "Always Start When Debugging" = True, with the first web app (the one that's redirecting) set as the startup web application. Does anyone know a trick that will let me step into the code in the second web application?
Open up a second instance of Visual Studio, then Ctrl+Alt+P (menu Tools > Attach to Process) then attach to the appropriate web server process (if you run under IIS this may be w3wp.exe or aspnet_wp IIRC, if you use the built in web server then attach to the process which lists the appropriate port for your project).
Optionally just run the second one and manually go to the first one in your browser by entering the appropriate address and trigger the redirect which you have verified is working.
Are both web applications running in the same process? What version of ASP.Net, IIS, and the .Net framework are you using? Those are my initial questions before I start giving other ideas.
I have several web application projects in one solution.
When I start debugging one of those web applications I noticed that the ASP.NET Development Server starts for all web applications in my solution.
How can I determine to just one ASP.NET Development Server to be started?
Is this even possible?
I don't want to have my system tray filled with icons of all my web applications.
Thanks!
Duplicate: Why do VS2008 spawn one Cassini for each web-site/application when going into debug mode?
This might work for you, I have a similar issue since there are several web remoting projects in my solution. What I did was set up virtual directories for each in IIS then just right-click the each project and select properties. On the Web tab I then set the server to use when debugging to IIS. This causes Visual Studio to use the single instance of IIS instead of opening a dozen separate web development servers for each project. When you debug, attach to w3wp.exe processes.
As far as I am aware you can't stop this behaviour and is by design.
This because of the way that VS attaches its debugger to target processes. i.e. you couldn't have two instances of VS attaching to the same process. Hence multiple instances of the cassini web server, one for each VS session.