Visual Studio opens Development Servers for all websites in my project - asp.net

I currently have a Visual Studio solution with 8 web applications.
When I try run one of these applications, 8 instances of the Casini Web Development Servers are launched.
Is there anyway to specify that only the web application I have set as startup project will be launched and not all 8.
I am using Visual Studio 2008
Thanks

Select the Solution. Right click and select Properties. Under Common Properties select Startup Projects. The select Single Startup Project, select the project you want to startup, and press Apply/OK.

Also there is a project option Always start when debugging. Select Project in Solution View and in Properties Window set this option to false. Without it the server is started even if project is not chosen as startup project.

Related

How to run an ASP.NET Framework project from a script?

I am trying to simplify some of the start-of-day tasks that me and the other developers must do at my company. In order to get our local dev environments running, we have to go through a series of steps: starting VMs, APIs, and other web servers. My goal is to write a script to automate all of this.
The only part that is giving me difficulty is one step in particular where we must start a gateway API project written in .NET Framework before starting the other microservice APIs written in .NET Core. The .NET Core APIs can easily be started via a script which we already use, but I was hoping to make the .NET Framework project part of this script too, which must come first before the other .NET Core APIs. Currently we open the .NET Framework project in Visual Studio, press Run, then run the script to start the other .NET Core APIs.
Does anyone have any pointers on how I can automate starting the .NET Framework project?
I assume you're using IIS Express for debugging, which means you have to open Visual Studio and start debugging for your website to start.
I suggest you install full IIS (not Express) on your machine. It has the benefits of:
You can still debug in Visual Studio
The application will always respond to requests, whether Visual Studio is running or not.
To do this:
In the Start Menu search for and open 'Programs and Features'
Click 'Turn Windows features on or off' on the left
Select 'Internet Information Services' in the list, with all the features you want (pretty much everything under 'World Wide Web Services' and at least 'IIS Management Console' under 'Web Management Tools')
I assume from there you know how to setup the website in IIS Manager. Do it the same as you would on a production server. Just point the site (or virtual folder) to where your code is.
In your Visual Studio project:
Open Project -> [Project Name] Properties...
Click 'Web' on the left
Under 'Servers', select "Local IIS" from the dropdown
Make sure the 'Project Url' matches where you set it up in IIS
There is also a "Create Virtual Folder" button there in Visual Studio that can help you set up the site, if you prefer.

References Assemblies for .Net framework version not found Visual Studio 2012

The aspx files for my website are giving the error: "References Assemblies for .Net framework version not found; please ensure they are installed, or select a valid target version." In my web.config file I am using .net framework 4.5.2, which is installed on my machine. When I view my website in a browser, it does not load any style sheets, instead displaying a directory of the pages. What would be the cause of this?
Open IIS Manager. Wnd+R type inetmgr
On the Connections pane, expand the server node and click Application Pools.
On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.
In the Edit Application Pool dialog box, in the .NET Framework version list, select the version that you want the application pool to use or select No Managed Code if the application uses only native code.
Click OK.

Visual Studio 2015 - Opening two projects in debug mode

I'm using Visual Studio Ultimate 2015 CTP (Version 14.0.22512.0 DP), and create two asp.net 5 vnext web applications.
When one is running, and I'm starting the second one with the context menu "Debug->Start new instance" option, the IIS Express crashes instantly (Internet Explorer opens firstly the second project, and then instantly closes both, Chrome simply display only that the page doesn't exist).
The only trace that I found is in the Event Viewer, a Warning from IIS Express:
The directory specified for caching compressed content C:\Users\Alek\AppData\Local\Temp\iisexpress\IIS Temporary Compressed Files\Clr4IntegratedAppPool is invalid. Static compression is being disabled.
Any suggestions how to fix this? It's hard to work on a multi-tier project when only one project can be run at a time.
When I created manually above folder, nothing is logged to the event viewer, but the IIS Express still crashes. On Visual Studio 2013 I can run two instances of two Web Applications withtout any problems
It should work if you set your solution to use multiple startup projects and add all the projects you need to debug
Really easy steps to follow here:
http://www.magnetismsolutions.com/blog/paulnieuwelaar/2015/04/07/debug-multiple-projects-at-the-same-time-in-visual-studio
Still not as easy as previous versions of visual studio
Maybe not a solution, but a workaround which I found - running two instances of Visual Studio 2015 allow to run two projects.

Debug ASP.NET web forms in full IIS

I'm running Visual Studio 2013 Ultimate on a Windows 8.1 (with Update 1) laptop, and I would like to debug an ASP.NET web forms project against IIS, which is installed on the local Windows 8.1 instance.
Previous versions of Visual Studio had an option to use IIS Express or full IIS, but I cannot find that option in the Project properties anymore.
How do I deploy & debug my ASP.NET web forms project in full IIS?
EDIT: When I right-click on my project, I see this:
And then if I click on "Properties Window" I see this:
This is one way to have your project available in IIS:
Press Ctrl+X, type inetmgr
or
Open your IIS Manager Application.
Expand the tree on the left.
Add WebSite
Give a name to the website and port
For file location provide the same file location were your project is.
Assuming your port number is 3000 just simply type http://localhost:3000 in your browser.
Now from Visual Studio go to:
file Open...
WebSite (you will see that IIS is available on the left).
Open your new web site
This will let you debug from IIS and any changes you make will be directly made on IIS as well.
I just double checked one of my local Web Forms applications locally running in Visual Studio 2013 Ultimate on Windows 8.1. The settings are still there. If you open the project properties for your Web Forms project, you should see the following:
After selecting Local IIS, setting a port, and saving, you should be walked through the process of configuring a Virtual Directory for your site (if one isn't already configured).
EDIT
After looking at your edit, it looks like you've created a Web Site Project rather than a Web Application Project. You can read about the various differences here:
Web Application Projects versus Web Site Projects in Visual Studio
If you haven't written any significant code yet, I'd suggest deleting the Web Site Project and creating a new Web Application Project. You'll then see the settings as described above.
If you really want to keep the Web Site Project, you'll have to configure the site in IIS and then open it in Visual Studio using the 'Open Web Site...' dialog (and then choosing Local IIS as the source):

Run multiple web forms apps in same solution in visual studio

I have two web forms applications in one solution in Visual Studio 2012. At work, it creates both, but runs only the startup project in debug mode. I can also pull up the second application at the same time. However, in the same solution with the same copy of Visual Studio, my home computer only opens one of them at a time (Only the one you select as the startup project).
How can I get visual studio to run both?
Right-click your solution, and select Properties. On the left side, navigate to Common Properties -> Startup Project.
Now you can select "Multiple startup projects" and specify which projects will start (with or without debug) when you run the solution.
In the solution explorer, right-click on the solution, and choose "Set Startup Projects".

Resources