Configure Visual Studio 2013 .sln to use Local IIS (Not Express) - asp.net

I keep getting errors saying that my IIS express has stopped working and I would like to configure my project to use IIS instead of IIS Express. When I run it I can see that is says IISExpress, as seen in the picture below. I tried to research a possible solution and saw that some people were able to go to properties and change the server to use Local IIS but I don't think I have that option available in the same place because I am using a different type of project. How would I be able to configure my project to use Local IIS (and stop receiving these "IIS Express Server has stopped working" error messages).
Thank you

You need to adjust the project properties to point to IIS.
See: MSDN

Related

Problems publishing site to localhost on windows 2008 rs server

I must preface this post by saying that I am not an experienced developer, I am in the process of learning through trial and error and a lot of google searches so detailed (step-by-step) feedback would be greatly appreciated. I created a website, which does not use a database, using visual studio 2015 and I am attempting to host it locally on a Windows 2008 R2 server.
I installed IIS and loaded the asp.net v4.0 framework. The site works fine, produces no errors when I test it and works after being published only if the visual studio is still running.
However, when I close the Visual studio and open my browser window to http://localhost:50044 (which is the URL listed in properties menu in VS), I also tried using port :80 and nothing. When trying to add Web Site via the IIS management utility I receive the following authentication error: ”Cannot verify access path (C:\Inetpub\wwwroot).”
I checked the permissions and windows authentication is enabled with read access, and all other permissions seem to be correct. I am at a loss, I'm sure it is probably something simple that I am missing due to my lack of knowledge and experience. Any help would be appreciated.
It's sounds like you are running on IIS express which in your case stops running when you close visual studio. Normal process is create a new website in IIS and point to the folder where your web.config is. You can then hack your host file (C:\Windows\System32\drivers\etc) so DNS works. Add an entry like "127.0.0.1 mytestwebsite.com". I hope that helps
So I figured out part of what was happening. I didn't realize that visual studio has built in IIS and was using that by default.
I ran VS as an admin, created a new project, then attempted to create a virtual directory thru VS under the project/properties/web tab. I selected local IIS and entered http://localhost/boc and it returns an error: unable to create vd. Web server http://localhost... Could not be found.
I then went in to the IIS manager and set up a virtual directory with no issues. However, when I attempt to reference it thru VS I again receive an error message.
Any ideas?

How do I change where Visual Studio looks for applicationhost.config?

I've looked all over this site and I cannot find the answer to this question.
Basically I'm trying to set up a new site for use with another project I'm working on. This site will run locally on my personal computer and will also be accessible via internet. So I installed IIS 7.5 Express and IIS Manager 7 to host this site. When I went into VS 2012 elevated to create a new site and map it to 'localhost', it pulled up the following error:
Invalid URI: The hostname could not be parsed.
2nd attempt was by creating the site in a new directory by itself inside inetpub, just for the project itself and leaving wwwroot alone. When I do this, I get the following errors:
Filename:
\?\C:\Users\Joel\Documents\IISExpress\config\applicationHost.config
Error: Cannot read configuration file
File system Web sties are currently configured to use IIS Express. To switch back to using the Visual Studio Development server, change the development server option under the Projects and Solutions\Web Projects category of the Tools\Options menu.
When I browse the above location, applicationHost.config does not exist, but when I go to
C:\Windows\System32\inetsrv\config
I find it just fine. IIS Express 7.5 works fine and IIS Manager can find the default site just fine and will even let me browse it using my web browser. What am I doing wrong and how can I fix this so that VS 2012 can create web sites and access the necessary files.
I run Windows 7 Professional x64 and I just finished installing IIS Express and IIS manager. I configured VS 2012 for Web Development. I ran VS as Administrator (elevated) for all of this.
Okay, I found the solution. I needed to manually set Visual Studio NOT to use IIS. Not sure what the issue is there.
But the solution is here for everyone else having this issue.
It was right there, I'm sure, when I was setting it up initially and I just missed it. After doing that, I could set up the new website to use the file system, which would bypass IIS anyway, but the setting to use IIS was conflicting with the bypass, which caused the error.
Hope this is superhelpful!

URL rewrite rule not working in Visual Studio Development Server

How can I troubleshoot url rewrite rules that are not working in my Visual Studio 2010 Development environment?
I am enhancing an existing ASP.NET application.
My issue is the URL rewrite rules written in web.config do not work in my Visual Studio 2010 development environment. It only works after deploying the project to IIS.
I need to debug the project as I am not familiar with how it is designed and developed. It is too big a project.
If rewrite won't work in the Visual Studio Development Server, is there a workaround? I really need to work on the project in debug mode. Every time it takes me to a custom error page.
You can always debug into your local IIS. There are 3 approaches:
You should be able to do this seamlessly if your project is configured to deploy to the local IIS web server - just hit F5. It should deploy then attach.
After you deploy, browse to the local site, then attach to the running site by using "Debug, Attach to Process, w3wp.exe".
Add System.Diagnostics.Debugger.Break() to the line on which you want to break your code, deploy to IIS, then run. A "start debugging" dialog should appear when the line is hit.
URL Rewrite does not work on the built in web server used by Visual Studio. The good news is that you can absolutely debug the site easily using a local install of IIS. See the following blog entry for details on how to do this:
http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx
I would strongly suggest going the route of IIS Express (a quick web search will get you to the download page) that Scott recommends. I tried setting VS up to use my local IIS 7 and struggled with it. When I tried the IIS Express route, I was up and running in minutes with URL Rewrite working nicely in my dev environment - no need to manually attach to anything. After installing IIS Express, I just had to go into the site properties->"Web" tab->"Servers" heading->select "Use Local IIS Web server" and check "Use IIS Express".
If you create an IIS website on your local machine then rewrite should work.
If you don't have IIS installed I think you can download it using the MS Web Platform Installer.
I'm not sure if the debugger will work in this situation, but at least you don't have to deploy to a remote machine to test your changes.

Debugging ASP.NET in IIS 7

I have searched all the usual but come up empty. I must be doing something silly!
Simply I created a new project, ASP.NET Web App, and wish to use and debug it with the local install of IIS 7.5 on my Windows 7 x64 box.
According to what I have read it should be a simple process; my issue is that Visual Studio will not stop at breakpoints nor at errors etc.
I just don't get it:
Visual Studio is attaching to the w3p process for me automatically.
If I hover over the breakpoints it shows a message saying the same, that it is in the same w3p process.
I am in Administrator context. I manually ran it like so to be sure but in any case if you are an admin it runs like that anyway.
Some notes:
I do not wish to use IIS Express as I require native IIS 7.5 for my tasks, however it does debug in express - no surprise there.
As mentioned above, all this is being done locally.
The path of the virtual directory is pointed towards the project files, as set by Visual Studio 2010. It even set the Network Service as read on the folder structure.
When debugging from VS the web site runs fine, just debugging is the issue.
Maybe it is permissions? The Default App Pool is using the ApplicationPoolIdentity not Network Service... Should it be? I had assumed they we.re one and the same essentially. Although I changed this and no luck unless I didn't do something I should of
Keep in mind here that my issue is semi-unique in that I am not receiving error messages, not even in the event logs... For all intents and purposes it should be working fine, just it isn't.
VS and IIS, and all updates, are applied to date.
Note: I'm familiar with IIS7.5, I run my own public web hosting server. I just never tried to debug
Note: It is Visual Studio 2010 Ultimate
Thanks for your time.
Sigh!
I went back to basics... Uninstalled IISExpress and tested; It worked! Re-installed IISExpress; It worked!.
I guess installing IIS7 native after IISExpress did something screwy? I had ran the register ISS command on IIS7 when I installed it.
Right, so now I have both installed in tandem and they work fine. Thanks for all your help guys, appreciated.
you can try right-click on project in VS go to properties select web from left menu tab. Check if ASP.NET debugger is checked and also you can select Use Local IIS Server and give localhost url there (in project Url textbox) and then Say start debugging from VS and put breakpoints.
I had a similar issue the other day, I attached the debugger to the wrong w3p process, make sure you attach it to the one the app pool identity is running under.
I wanted to write it as comment by I don't think I can add pictures..
Are you sure you are running the same version of dll?
Is your breakpoint filled like this?
or hollow like this?
1st go to ,Program and Feature in control panel and then in that turn on or off windows features. and now check all check boxes(activate features) related to Internet Information server & windows service managers. once this is done run your visual studio as administrator and then attach to right w3p process.

Error : "Unable to start debugging on the web server..." ASP.NET 4.0

I am getting an error when I want to create a web site on IIS server. I am using Windows 7 and Visual Studio 2010.
Do I have to register or configure asp.net 4.0 for the IIS ?
There aren't many details here, but I was getting that same error while trying to Start Debugging on a web application project in Visual Studio 2010 that I'd just changed from 3.5 to 4.0.
This solved the problem for me from the command line:
cd %windir%\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -i
Just make sure to go into IIS Manager afterwards and double-check your application pools and such, since it's likely that this will reset some of your configuration.
This did the trick for me:
In IIS > under .NET compilation
Note: Default Website is selected only for screenshot purposes.
Changing the Debug option to True
This error can appear if the password for the account used by the application pool changes. If you start getting this error after changing your network password you may need to update it for the application pool used by your local web sites as well.
In Visual Studio 2010 this usually means there is a problem with Web.Config file that cannot be displayed in Debug mode. So, simply start the app using Ctrl F5 to run in normal mode will tell you which line in Web.Config is faulty.
Check that the path of your site in IIS points to the path of your web project in VS.
I ran across this before and it was an issue of mismatched paths. If you've configured Visual Studio to use IIS and later on changed paths, IIS isn't updated automatically. You need to manually go into IIS and update the path.
Make sure your site is setup to debug (debug="true") under web.config file
<compilation targetFramework="4.0" debug="true">
For me this was related to this solution: http://www.codeproject.com/Questions/83338/Does-not-have-write-access-to
cd %windir%\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis -i
aspnet_regiis -ga "IIS APPPOOL\DefaultAppPool"
Note this didnt work after I did it on Framework folder and then worked after I did it on Framework64 folder. I guess do both to be sure.
Tried running vs2010 as administrator?
Also try
1. Open IIS. Click “Default Web Sites”.
Check if “Anonymous Authentication” is enabled.
Enable “Windows Authentication” as well.
I've had this several times - in my case it's always that I've not updated my hosts file so VS is trying to locate an external DNS instead of my local one.
I spent a few hours fighting with this issue. In the end it seems to be that some changes made outside VisualStudio had confused it. I don't know what the issue actually was but things started to work again when I opened a different version from the same solution so that VisualStudio (or IIS) did some magic on the IIS configuration. Then I changed back to the original solution, the configuration was again modified - and now debugging works again.
Another reason would be if you have SSL Certificate installed on IIS. You will have to disable the SSL from IIS manager for the application that you are debugging. Because Visual Studio tries to launch it as http instead of https.
In my case, I was receiving a 0x80004005 error message box in VS2019.
That was caused by HSTS being enabled in the "Advanced properties" on the website.
Screenshot of advance site settings in IIS
Found this post which seems useful if someone wants to do debugging with HSTS being enabled: https://scatteredcode.net/debugging-on-localhost-with-hsts/
I get this same error every time I set my project file as a share.
I resolved it by going into the security tab of the file and re-adding "IIS AppPool\DefaultAppPool"
In my case, i have to change the certificates bindings in IIS>Default Web Site > Binding.
IIS Binding
If you are using Visual Studio, you need to check what server you are trying to run your application on.
Right click on the project
-> Web
-> Servers
-> In the first dropdown choose "IIS Express" (To debug with VS).

Resources