[visual-studio] Unable to launch the IIS Express Web server

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.


This question is related to visual-studio iis iis-express

The answer is


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.


After disabling the firewall I was able to run it without any issues.


None of the other solutions worked for me. I disabled edit-and-continue, and all is well :)


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.


There is no need to delete the entire IISExpress folder in the directory C:\Users[you]\Documents\IISExpress.

Just comment:

<binding protocol="https" bindingInformation="*:8090:localhost" />

in the applicationhost.config file in the IISExpress folder.


@roblll had it right. But for those of you who didn't want to dig for the answer, here it is:

  1. Close Visual Studio (might not be necessary, but it won't hurt).
  2. Navigate to your Documents folder. This is where my IISExpress configuration directory was.
  3. In the config folder, there is a file called the application host. Open that.
  4. Search for the name of your project. It should have been added in there by Visual Studio when it bombed in your previous attempts.
  5. Note that there's a binding for HTTP with the port you intend to use for https.

    //Change this:
    <binding protocol="http" bindingInformation="*:44300:localhost" />
    
    //to this:
    <binding protocol="https" bindingInformation="*:44300:localhost" />
    

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.

  1. In VS2013 Opened Debug > {YourWebsiteName} Properties
  2. Select the "Web" tab.
  3. Under "Servers" I found "Override application root URL" was checked. I unchecked it and saved.

That was all I needed to get things running.


i will suggest one way to fix this issue:

1.Delete the \Documents\IISExpress folder using the following console command: rmdir /s /q "%userprofile%\Documents\IISExpress"

  1. Delete the applicationhost.config file which is placed within the .vs\Config\ folder in your Visual Studio project root folder.

  2. Change the project’s website random URL: within Visual Studio, right-click to the project node in Solution Explorer, then select Properties; navigate through the Web panel, then change the number in the Project Url textbox value.

  3. Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1 as shown in the following screenshot (thanks to Juan M. Elosegui for reporting this on this SO thread and for the image):

enter image description here

Good Luck !


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.


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


The only solution that worked for me was to create another test project. Then following the next steps:

  1. Right click the project and go to Properties -> Web

  2. 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.

  3. Navigate to the project which is giving this error. Right click the project and go to Properties -> Web.

  4. Paste the project URL in the Use Local IIS Web Server section (URL copied from the test project). Close the test project and save.

  5. 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.


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!


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.


I had the same problem, in my case I just cleaned and then rebuild my solution and it worked for me


I had the same problem.Please Follow below steps :

1- Open applicationhost file in Documents\IISExpress\config and add below code if it's not exist

            <site name="solutionname" id="2">
                <application path="/" applicationPool="solutionname">
                    <virtualDirectory path="/" physicalPath="physicaladdressofproject" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:xxxx:localhost" />
                </bindings>
            </site>

2- Then go to the root file of your project and delete all of updates are done on the project by using different version of Visual Stdio

3- Next go to [root].vs\config and delete applicationhost it will be created automatically

4-Run the project

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.


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"

My issue required a 3-fold solution:

  1. Remove the IISExpress folder in your Documents folder.
  2. Set the web project as your startup project by either right-clicking it and select "Set as startup project", or doing so through your solution properties.
  3. Set the startup URL, or set to "Current Page" or "Specific Page". Mine was set to "Don't open a page. Wait for a request from an external application" and I had to change it to "Specific Page", which I leave blank so it will go to my app's home page, before it would work.

Restarting the computer was the only thing that worked for me. Classic 101 IT :)


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 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


The solution for me was switching from IIS Express to Local IIS. Solution properties Make sure though your virtual directory is bound to the same port.


I had the same issue. I resolve it by changing port number from project properties. I changed my port number 50624 to 50625.

enter image description here


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.


For a 2021 Solution in dotnet core, you can fix this error by right-clicking the project in Solution Explorer, and choosing 'Edit Project File'.

On the Debug Tab, at the bottom, you can directly configure the desired port and whether to use SSL or not.

enter image description here

Changes here need to be saved with Control+S. Once that's done, you can launch the project and confirm it fixed your issue, no having to delete IISFolders or anything else suggested here.


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.


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

None of the methods presented here worked for me. What finally worked was to set the DevelopmentServerPort to 0 in the .csproj file:

    <WebProjectProperties>
      <UseIIS>True</UseIIS>
      <AutoAssignPort>True</AutoAssignPort>
      <DevelopmentServerPort>0</DevelopmentServerPort>
      <DevelopmentServerVPath>/</DevelopmentServerVPath>
      <IISUrl>http://localhost:52973/</IISUrl>
      <NTLMAuthentication>False</NTLMAuthentication>
      <UseCustomServer>False</UseCustomServer>
      <CustomServerUrl>
      </CustomServerUrl>
      <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
    </WebProjectProperties>

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 
  1. Close all Visual Studio solutions.
  2. Rename IISExpress folder to some IISExpress-Copy (instead of deleting you can have a copy of it)
  3. 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.


VS2015

edit file .csproj.user

Insert the following xml tags (do not duplicate if already exists)

<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>2870</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:2859</IISUrl>
<OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
<IISAppRootUrl>http://localhost:2859</IISAppRootUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>http://localhost/app</CustomServerUrl>

Insert above tags in XML node bellow:

<ProjectExtensions><VisualStudio><FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"><WebProjectProperties> 

Please go through the snapshot, I faced the same error but the following setting resolved it

  1. Select Current page as Start Action

  2. Select specific port in Servers option and enter port 26641 , in virtual path enter /

  3. NTLM option should be unchecked


In my case, I went to Debug > Project Properties > Web (in visual studio) and then I changed IIS Express to Local IIS in servers section


  1. Close all instances of Visual Studio.
  2. Open Task Manager.
  3. End all active IIS processes.
  4. Restart Visual Studio.

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.


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.


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.)


Had been messing around with IISExpress and Project to try and get it listening on a different URL than localhost, when reverting back I had this error and after following all the answers here, none of them worked.

Eventually noticed that in the projects Porperties -> Web I had 'Start URL' checked under Start Action, but the input box was empty. Changing this to 'Current Page' fixed my issue.


I had the same issue. I had deleted a lot of folders under C:/users/ path to free some space on my machine. After which I started getting this error.

I just had to restart my machine and it all worked fine.


I was also facing this problem after I run XAMPP's Apache Server on my PC. For running it, I kill all the process on 8086 port by writing net stop http on the administrator command prompt. I think killing the processes caused this problem for me.

For me, this problem is solved after doing the following steps;

  1. Closing Visual Studio and SQL Management Studio.
  2. Going to Services and starting all SQL services except SQL Server Agent (SQLEXPRESS).
  3. Going to C:\Users\<your pc name>\Documents and deleting IISExpress folder.
  4. Restarting PC. (new thing todo which I don't found above)
  5. Starting the Visual Studio and running the program.

Delete contents inside IISExpress folder and Close and Open the visual studio. and Run again. It should be fine.

Or Change the port number


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:

  1. Right click the project and go to Properties -> Web
  2. 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)
  3. 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)
  4. Navigate back to Properties -> Web and add the "s" back to the project URL.
  5. F5 and ride!

Make sure that the check box for Override application root URL is unchecked.


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.


Same Problem, but needed to start VS2013 in Admin Mode.


Try following steps:

  1. delete the IISExpress folder as @Yehuda Shapira said
  2. restart computer
  3. delete the .vs folder in project

Have a good luck!


I read all the answers herein and then, as mentioned in Mihail Shishkov answer, jumped to Project Properties > Web > Servers > Create Virtual Directory. This had the effect of getting me by the exception:

Unable to launch the IIS Express Web server. The start URL specified is not valid. http://localhost:44300/


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 ran into this exact problem recently and it was because the project was stored on a network drive. Since IIS locally runs as NetworkService it didn't have access to the network share where the project was stored. Assuming that opening a project from a network share is against best-practices, I copied the project to the local C:\ drive and then the project ran as expected.


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.


Start with deleting the file IISEXPRESS that exists in your directory, then start debugging.

If that does not solve the problem, go to your Project (Ctrl+Alt+L). Right click -> Properties -> Debug and Check "Enable Windows Authentication".


I too had this issue, after turning off the firewall, after opening as administrator, after double checking all the settings were correct.

My problem was unique in that I wanted to test SSL locally, but also have the service available over the LAN. So I'd changed the app URL to use the local IP aka. 192.168.1.10 in my case.

Switching back to localhost fixed the problem, as did turning off SSL, so I discovered that the local SSL cert only worked for localhost.


I had the same problem after installing Visual Studio 2013 Update 3.
VS 2013 can not load Microsoft.VisualStudio.TraceLogPackage.dll
Unable to launch the IIS Express Web server

My problem solved by doing the following steps :

1. Repair Visual Studio 2013 Update 3
2. Start the Developer Command Prompt as administrator.
3. Type devenv.exe /setup then press enter


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 for example 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

enter image description here


In my situation, the IIS Express applicationhost.config file had a typo in the managedRuntimeVersion attribute of several elements. This was happening for both Visual Studio 2012 and Visual Studio 2013. I only received the first part of the message, stating:

Unable to launch the IIS Express Web server.

It logged an error in the event log with the message:

The worker process failed to pre-load .Net Runtime version v4.030319.

The correct runtime version is v4.0.30319 (note the second period.)

The steps I took to correct:

  1. Navigate to C:\Users\\Documents\IISExpress\config
  2. Edit applicationhost.config
  3. Find the config section
  4. Correct any references to "v4.030319" to read "v4.0.30319"

Visual Studio successfully started IIS Express the next time I debugged a web application.


My problem was eventually solved when I looked at the IIS Express registry key:

HKEY_CURRENT_USER\Software\Microsoft\IISExpress

I had an entry CustomUserHome pointing to My Web Sites which was causing havoc.


Examples related to visual-studio

VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio? How to download Visual Studio Community Edition 2015 (not 2017) Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error How to fix the error "Windows SDK version 8.1" was not found? Visual Studio Code pylint: Unable to import 'protorpc' Open the terminal in visual studio? Is Visual Studio Community a 30 day trial? How can I run NUnit tests in Visual Studio 2017? Visual Studio 2017: Display method references

Examples related to iis

ASP.NET Core 1.0 on IIS error 502.5 CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default Publish to IIS, setting Environment Variable IIS Manager in Windows 10 The page cannot be displayed because an internal server error has occurred on server The service cannot accept control messages at this time NuGet: 'X' already has a dependency defined for 'Y' Changing project port number in Visual Studio 2013 System.Data.SqlClient.SqlException: Login failed for user "This operation requires IIS integrated pipeline mode."

Examples related to iis-express

HTTP Error 500.30 - ANCM In-Process Start Failure localhost refused to connect Error in visual studio How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)? Process with an ID #### is not running in visual studio professional 2013 update 3 Unable to launch the IIS Express Web server, Failed to register URL, Access is denied Why and how to fix? IIS Express "The specified port is in use" How can I change IIS Express port for a site Authentication issue when debugging in VS2013 - iis express ASP.NET MVC5/IIS Express unable to debug - Code Not Running How to solve “Microsoft Visual Studio (VS)” error “Unable to connect to the configured development Web server”