I have an asp.net MVC 4 solution. When I try to open it using Visual studio 2012, I get following error:
Microsoft Visual Studio Configuring Web https://localhost: for ASP.NET 4.5 failed. You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly. Could not find the server https://localhost:44300/ on the local machine. Make sure the local IIS server has been configured to support secure communications. OK Help
Although the solution opens. Also, When I try to run it from debug menu, I get following error:
Unable to launch the IIS Express Web server.
The start URL specified is not valid. https://localhost:44300/
and I can not debug the code. how to get rid of these errors and debug/run the web site from VS 2012 ?
Please suggest.
You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly.
and 2) The start URL specified is not valid.
. Also you seem to be using HTTPS; AFAIK IIS Express doesn't support that (and if it does you'll probably need to configure it, hence the Make sure the local IIS server has been configured to support secure communications
part). Edit: It does seem to support SSL: riii.nl/apr5u, a step-by-step guide by Hanselman himself!
I had the exact same problem. The reason - bad IIS config file.
Try deleting the automatically-created IISExpress
folder, which is usually located at %userprofile%/Documents
, e.g. C:\Users\[you]\Documents\IISExpress
.
Don't worry, VS should create it again - correctly, this time - once you run your solution again.
EDIT: Command line for deleting the folder:
rmdir /s /q "%userprofile%\Documents\IISExpress"
If using VS2015 or above
Make sure iisexpress process is not running.
Make sure no other process is using your desired port. You can do that by executing
netstat -a -b
in the console (as Administrator, type cmd
in start menu, right click and choose 'Run as admiminstrator'). If you see an entry which state is ESTABLISHED or LISTENING it means that some other process is using this port. You'll need to terminate that process or change the port.
Then delete the following file
<<path_to_solution_folder>>\.vs\config\applicationhost.config
note the .vs
folder may be hidden
then find <<project-name>>.csproj.user
file, open it with text editor (notepad) and make sure IISUrl
under WebProjectProperties
is configured to <IISUrl>http://localhost:XXXXX/</IISUrl>
where XXXXX
is your desired port.
after doing this and trying to start the app you may get
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Then go to {Project Properties} -> Web and Press the "Create Virtual Directory" button
https://i.stack.imgur.com/BQNrn.png
@roblll had it right. But for those of you who didn't want to dig for the answer, here it is:
Close Visual Studio (might not be necessary, but it won't hurt). Navigate to your Documents folder. This is where my IISExpress configuration directory was. In the config folder, there is a file called the application host. Open that. Search for the name of your project. It should have been added in there by Visual Studio when it bombed in your previous attempts. Note that there's a binding for HTTP with the port you intend to use for https. //Change this:
Keep in mind, Visual Studio might have supplied different ports than you expected. Just make sure that the ports in the binding correspond to what's in the Web tab of your project's properties.
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
I had the same problem but the solution that worked for me was different.
In VS2013 Opened Debug > {YourWebsiteName} Properties Select the "Web" tab. Under "Servers" I found "Override application root URL" was checked. I unchecked it and saved.
That was all I needed to get things running.
Try following steps:
delete the IISExpress folder as @Yehuda Shapira said restart computer delete the .vs folder in project
Have a good luck!
Same Problem, but needed to start VS2013 in Admin Mode.
I had the same issue and then I opened the task manager -> processes then killed the iisexpress.exe process. After that I tried to run the application and was able to run it successfully
In my case the project was on network drive and deleting IIS Express folder didn't help as described in other answers. My workaround was copying the project to local drive and it worked!
I had the same problem, thanks to @Jacob for giving information about it.
The Reason is - wrong entry for your project in config file applicationhost located at
C:\Users\(yourusername)\Documents\IISExpress\config
Close all Visual Studio solutions. Rename IISExpress folder to some IISExpress-Copy (instead of deleting you can have a copy of it) Now open VS again and build/debug the project, now you would see IISExpress folder created for you again with correct configuration.
It worked for me and hope it should work for you also.
IISExpress
folder. Deleting it did not work for me.
I had the same issue, the cause was that the flag "override application root URL" was set under Properties --> Web After I removed the flag, IIS Express was starting fine with the defined port.
It seems you need to do some configuring as you seem to be using SSL; here's a step-by-step guide by Scott Hanselman himself.
The only solution that worked for me was to create another test project. Then following the next steps:
Right click the project and go to Properties -> Web Under the project URL in the Use Local IIS Web Server section, copy the project URL(http:// localhost:59002/) - this is from the test project. Navigate to the project which is giving this error. Right click the project and go to Properties -> Web. Paste the project URL in the Use Local IIS Web Server section (URL copied from the test project). Close the test project and save. Delete the test project and run the project that gave the error. Works after that...
Maybe not the best way but it was the only way I could get this to work. I received this error message after I reloaded my laptop (hard drive crashed) and got all of my projects from the server of where they where hosted.
Sharing this for future readers. Manually creating a virtual directory worked for me.
Select project in solution explorer
Press Alt + Enter
Go to Web section
Click Create Virtual Directory
After Two Hour searching on web i found my solution as bellow steps - close visual studio - remove .vs folder of your project - open visual studio and rerun project
thats work for me have a good time
In my case after I allowed external request to my IIS Express website and configured windows firewall to allow iisexpress.exe, I can't start it from within Visual Studio 2013. I can still start it with command line, and it serves local and external requests well.
C:\Program Files (x86)\IIS Express>iisexpress /site:MyWebSiteName
I tried to create a firewall rule to allow my port, after that VS worked.
I had the same problem with VS 2013 and even after all possible tries it was not working.My problem was solved by:
- In control panel (Program and Features) I found that all of the IIS related features were unchecked.I finally checked all of those and restarted my system.
- Then I started my VS 2013 as administrator and thats it everything
worked fine then.
At least you can give this a try since it worked for me.
I had the same problem, in my case I just cleaned and then rebuild my solution and it worked for me
I had similar issue - VS couldn't load particular web project because of that error. Here is what helped:
Edit project in solution
Look for UseIISExpress and/or UseIIS sections and make sure that they don't intersect with each other.
In my case it was like this:
...
<UseIISExpress>True</UseIISExpress>
...
<UseIIS>True</UseIIS>
...
So, I've changed this to:
...
<UseIISExpress>True</UseIISExpress>
...
<UseIIS>False</UseIIS>
...
and then it worked.
Close all instances of Visual Studio. Open Task Manager. End all active IIS processes. Restart Visual Studio.
We had the same issue with our sites. We were able to fix this all inside of Visual Studio. We are using 2012 Ultimate.
The underlying issue we saw was that with SSL enabled, for some reason, VS was assigning the same port for the standard and secure URLs. This issue seemed to arise when we were pulling the code down from TFS.
To remedy it, we undertook the following steps:
Right click the project and go to Properties -> Web Under the project URL in the Use Local IIS Web Server section, remove the "s" from the URL and Save. (EG. go from https://:44301 to http://:44301. This will allow the next step to work) In Solution Explorer, select the Project and in the Properties window (press F4 if not displayed) change SSL Enabled to False then back to True. It will generate a new port that is different from the standard URL (In my case, I have 44301 as my SSL and 44305 as my standard) Navigate back to Properties -> Web and add the "s" back to the project URL. F5 and ride!
Make sure that the check box for Override application root URL is unchecked.
check the antivirus firewall and allow access visual studio to network. for example in nod32:
goto setting (f5) -> network->personal firewall->rules and zones
in the "zone and rule editor
" click "setup
" and find the vs 2010
or 12
or ... and allow access to network.
After disabling the firewall I was able to run it without any issues.
I ran in to this error today. Running Win 8.1 and VS 2013. Suddenly my projects could not run anymore and i got the message "Unable to launch the IIS Express Web server" and no further information.
After a while I found out that all the projects that the IIS Express could not start all were running .net 3.5. Projects running later versions did start ok.
The solution for me was to remove .net 3.5 (from control panel -> turn windows features on/off), restart windows and the add .net 3.5 again.
I'd set up Internet Connection Sharing on my machine for virtual machines. I switched it off and I was able to debug in Visual Studio 2015. However to consistently debug following a reboot, I needed to set the Internet Connection Sharing service to manual start up, even though none of my internet connections had Internet Connection Sharing enabled.
Well none of the above mentioned steps worked for me. In my case my applicationhost.config
file was somehow missing the following two line of code
<add name="rules-64-ISAPI-2.0" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
<add name="xoml-64-ISAPI-2.0" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
Hope this can help some one.
Along with the answer given by @Yehuda Shapira I had to make another change which is Delete the .csproj.user file where the binding information like
<IISUrl>http://localhost:54462/</IISUrl>
is stored.Delete that File Close visual Studio and then rebuild.Hope this helps.
Before you try anything else, make sure you 1. restart visual studio (mostly for refreshing memory resident options from files) and 2. restart your system (mostly for invalid file locking). If your problem is such temporary or self-fixed those will do without changing anything. It worked for me with PC restart. Also if you work on a multi-user project make sure you have the latest workable version - someone else may had check in something invalid by mistake at e.g. the project file and you mess with your system for no reason. If those won't work, then you probably need to alter some setting(s) that are stuck, missing or need modification - there are plenty propositions on other answers.
in my case I added new site binding on applicationHost.config file after delete that binding it work correct. the applicationHost.config path is in youre project root directory on .VS(hidden) folder
I had a similar problem when running my solution from VS2012:
Unable to launch the IIS Express Web server.
The start URL specified is not valid. https://localhost:44301/
I had the incorrect project selected as Startup Project. I made the Cloud project the Startup (right click on project -> Set as Startup Project) and everything started working fine.
Jason's Shavers series of articles here http://jasonrshaver.com/?tag=/Client+Certificates explain exactly how to set up your applicationhost.config site entry to allow the app to run in either ssl or standard http.
One of the things he recommends is putting two binding entries for the site. This is what I did.
<bindings>
<binding protocol="http" bindingInformation="*:59945:localhost" />
<binding protocol="https" bindingInformation="*:44300:localhost"/>
</bindings>
He also recommends changing other settings as well. It worked on two of my three machines. Each time I am told to manually configure a site in the application host it usually has to do with the bindings. (example using same port for multiple web apps.)
Success story sharing