338

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.


Christian Phillips
  • 17,456
  • 8
  • 47
  • 77
DotnetSparrow
  • 26,358
  • 61
  • 174
  • 313
  • 4
    The error messages are pretty clear on what's wrong: 1) `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: http://riii.nl/apr5u, a step-by-step guide by Hanselman himself! – RobIII Apr 08 '13 at 07:04
  • 1
    @Robel, I see that in properties of site, under application tab, target framework is 4.5, and in Web Tab, Start Action is Current Page. should I change project url to http://localhost:44300/ ? I am using IIS express 8 – DotnetSparrow Apr 08 '13 at 07:09
  • It was the firewall setting :( – Moumit Nov 21 '15 at 19:57
  • 1
    I was able to solve this issue by following way - 1) Visual Studio - Options - > Search - IIS 2)Check "Use the 64 bit version of IIS Express for web sites and projects". – RedBottleSanitizer Nov 09 '17 at 20:51
  • I think this will help https://stackoverflow.com/a/54222339/2923956 . – Biswajit Panday Jan 16 '19 at 17:32
  • For me the problem was that once I set it up to debug with IIS, it would not switch back to IIS express despite selecting it on the Debug Profile - really annoying. The only way to get it to work was to Delete the IIS Debug profile. – Paul McCarthy Nov 02 '21 at 10:55

55 Answers55

416

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"
Yehuda Shapira
  • 8,060
  • 4
  • 46
  • 66
  • 7
    This worked for me. Even after uninstalling and reinstalling IIS Express 8, it kept the same config file so my issue persisted. I renamed the IISExpress folder to something else and a new folder was created with a clean version of the config file. – nthpixel Jul 18 '13 at 07:25
  • 2
    "In your default folder" Where exactly is that? I'm not seeing it in my solution at all. – Corey Ogburn Jan 07 '14 at 16:51
  • @CoreyOgburn It's not a solution folder, but a Windows folder. It changes, depending on your operating system etc. Try looking for it in your user's profile (i.e. C:\Users\Corey). – Yehuda Shapira Jan 08 '14 at 07:21
  • 25
    @CoreyOgburn Should be under Documents folder and IISExpress, (i.e. C:\Users\Corey\Documents\IISExpress\Config) and delete the config folder. I have same problem but this didn't fix it for me. – Arne H. Bitubekk Jan 08 '14 at 09:36
  • Worked for me too, although to stop the file being locked I had to go into task manager, show processes and end the IIS Express process (it's obvious what it's called). – Andy Brown Mar 22 '14 at 09:47
  • holly molly. I thought I need to edit registry for this... huh. 1 up. thx – gericooper Jun 04 '14 at 15:55
  • I had 'cannot read configuration file' errors after doing this. See http://stackoverflow.com/questions/15897726/iisexpress-8-cannot-read-configuration-file-redirection-config/24444023#24444023 – David Fidge Jun 27 '14 at 04:37
  • 55
    Thanks. Just don't forget to close then re-open VS for it to reconfigure the IIS Express. – Nick.T Jul 07 '14 at 13:21
  • Yep - worked for me. Renamed C:\Users\clay\Documents\IISExpress_Hide as ...\IISExpress_Hide and it re-created a "fresh" IISExpress folder, and IIS Express now runs again. – B. Clay Shannon-B. Crow Raven Sep 11 '14 at 18:56
  • 1
    I did that and it's not work for me then I restart the PC then all work calm. – Prageeth godage Sep 14 '14 at 11:12
  • 2
    Try to restart the machine (if deleting does not help). This solved the problem. – Chris W Oct 10 '14 at 07:09
  • This fixed this error and a problem I was having with website projects being renamed to something other than their directory name (detailed [here](http://stackoverflow.com/questions/27173749/i-cannot-get-projects-to-load-into-visual-studio-2013-with-the-same-name-as-thei/27173750#27173750)). – Chris Nov 28 '14 at 08:18
  • Did this solution, but also had to then reset up my startup project back to my web project via the Solution's properties, then change it from "Don't open a page. Wait for a request..." to "Current page". Worked fine after that. – vapcguy Mar 17 '15 at 21:20
  • [Recreating the virtual directory](http://stackoverflow.com/a/34161146/2404470) worked for me – xameeramir Dec 10 '15 at 16:10
  • 1
    Worked for me after closing *all open instances* of Visual Studio. If I only re-start the .sln file that is giving me trouble, it doesn't work. I had to close down even my un-related solution files. – bkwdesign Feb 09 '16 at 17:50
  • 1
    MSVS 2015 creates an applicationhost.config under a separate .vs directory in the solution directory. the file can be renamed out of the way and then on a restart MSVS will re-create it. My issue was due to an extra "globalmodules" line "httpPlatofrmHandler" custom set to the 32 bit location". The event log may show clues to google and "Process Monitor" can capture the command line sent from MSVS which indicated the custom config in use. – crokusek Mar 02 '16 at 03:54
  • 8
    @crokusek has the answer for VS2015 Update 3. Navigate to the ".vs\config" folder in the solution directory and delete the "applicationhost.config" file there. – AJ. Aug 22 '16 at 16:26
  • I also had to close my browser windows that were running the app. – Darrell Lloyd Harvey Mar 20 '17 at 19:24
  • It would be a bad idea to delete the config file if you do have other sites and data in it. There can be easier ways to fix the file, like https://blog.lextudio.com/jexus-manager-recent-changes-to-save-the-world-ada896d098aa and I welcome all feedbacks. – Lex Li Jun 19 '17 at 00:51
  • 1
    I did this, but I also had to restart my computer for it to work (like Zbigniew Wiadro suggested). – jahu Jul 11 '17 at 13:15
  • 5
    Try to delete the **.vs** folder in project If someone still didn't work after doing it and restart the computer, – sknight Sep 07 '17 at 02:27
  • 1
    Issue for us was "The following error ocurred when trying to config IIS Express for project" {project name} ". Filename: redirection.config Error: Cannot read configuration file". This was on a MacBook Pro running a Windows 10 VM. Deleting the suggested folder worked perfectly. Thanks @YehudaShapira! – azarc3 Nov 21 '18 at 14:36
  • 1
    Worked like a charm! – Hamza Khanzada Mar 25 '20 at 07:59
  • 1
    another life savior! – Pcodea Xonos Apr 27 '20 at 13:27
  • 1
    Worked For Me Also. Thanks – Sasindu Jayampathi Aug 10 '20 at 05:11
246

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

enter image description here

Mihail Shishkov
  • 11,469
  • 6
  • 44
  • 56
  • 1
    This worked perfectly on VS2015. Issue occurred to be after creating a legacy web application project in .NET core solution. – Sebazzz Jun 09 '16 at 19:49
  • This worked, .NET core tooling made a mess with IISE :/ – Keoz Jul 18 '16 at 20:55
  • I'm usually living in the OWIN/NancyFx world, so when I had to do a Web API project after a hiatus, I was puzzled, until I saw this answer. - good to know this factoid - thanks!!! – code4life Jul 29 '16 at 13:36
  • work on VS 2915 @mihail i didn't delete anything, just create virtual directory ... what does it need for ? – abdoutelb Sep 21 '16 at 15:05
  • 4
    @AbdouTelb check this out http://www.iis.net/learn/get-started/planning-your-iis-architecture/introduction-to-applicationhostconfig by deleting the .config file you basically ensure that the file will be recreated by vs and thus any problems associated with it (and there can be many) will disappear. This file is used by IIS Express the same way like IIS uses its own applicationhost.config file so it's the same like restore factory defaults. Create Virtual Directory alone is not sufficient to remove any problems that may hide in the file. In your case you just got lucky :) – Mihail Shishkov Sep 21 '16 at 15:14
  • Deleting the `applicationhost.config` under the `.vs/config` directory worked in VS2015. – ram Feb 16 '17 at 07:33
  • Make sure iisexpress is actually not running when you delete the config file. – Mihail Shishkov Mar 09 '17 at 09:03
  • I copied a solution structure (entire folder) over to a new machine and could not debug using IIS Express. I delete the .vs folder, after seeing this, and that solved the issue. Probably has to do with the previous config pointing to an invalid location as the previous solution was on a `D:` drive and the new one on `C:'. – Eben Roux Apr 11 '17 at 04:39
  • Can you please provide a demo or clear explanation regarding this , because you have mentioned You can do that by executing netstat -a -b in the console. – Meena Jun 30 '17 at 07:00
  • @Meena on the picture above, you see that the port used is 50333. You can run cmd as administrator, type netstat -a -b and check if there is an entry for this port 50333. 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. – Mihail Shishkov Jul 03 '17 at 08:27
  • Thank you Worked for me , just by deleting the \.vs\config\applicationhost.config – Amir Bennasr May 18 '19 at 16:02
  • This was my problem and solution in VS2019! – Mark Good Apr 16 '20 at 12:54
84

@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

Hp_issei
  • 554
  • 6
  • 17
Jacob Lauzier
  • 865
  • 6
  • 3
  • 5
    I was actually opening a project developed elsewhere, changing the _protocol_ configuration for the project to _https_ and reloading the project got rid of the error. Thanks @Jacob! – Geoffrey Apr 03 '14 at 11:51
  • Only deleting the IISExpress folder didn't solve for me. After deleting, when I relaunched VS and opened this project, an error dialog appeared, which was solved only after doing this. That project I downloaded in **asp.net**'s page, it was a sample project. – Alisson Reinaldo Silva Jul 18 '16 at 16:44
  • Btw, if you have both http and https bindings, make sure you're not using the same port number on both of them. – Ziad Akiki Nov 15 '19 at 07:51
43

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.

The Red Pea
  • 14,933
  • 15
  • 89
  • 118
centralscru
  • 6,380
  • 3
  • 30
  • 40
  • I recommend you try this solution first. Ticking the box with an invalid url will create the error mentioned in the question. – timothy Nov 30 '16 at 03:49
  • Using VS 2019, one of my sites that was using the "Override application root URL" was checked. " would not run, but others using the same pattern would run ok. Tried disabling that option, and trouble site started working. – seagulledge May 18 '22 at 17:39
21

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!

sknight
  • 973
  • 9
  • 13
  • 3
    1.Close Visual Studio 2.Delete .vs folder that's worked for me. If I delete the .vs dolder while VS is open. It does not work. – akdora Jan 13 '19 at 14:48
  • 1
    Deleting the .vs folder is the sole thing that worked for me. The .vs folder is located inside the project folder, but it is hidden by default. – George Mar 29 '19 at 09:03
17

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

mat
  • 1,347
  • 1
  • 13
  • 18
  • 1
    Unfortunately this didn't help me. – AH. Oct 15 '16 at 13:57
  • 1
    However, why? It was working fine without going into the folder to run devenv.exe Run as Admin. Now I have to run devenv.exe as Administrator. – Nate R Jul 10 '20 at 22:19
  • Maybe some update was installed with administrator rights and since then it wouldn't work without admin privileges anymore. – mat Sep 09 '20 at 11:33
15

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

Vinu
  • 151
  • 1
  • 2
14

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!

Amir Chatrbahr
  • 2,120
  • 20
  • 29
13

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.

splattne
  • 102,384
  • 52
  • 205
  • 248
user2732247
  • 131
  • 1
  • 2
  • I tried the steps outlined in the other answers but this is the one that worked for me. I had to rename the `IISExpress` folder. Deleting it did not work for me. – webworm Dec 23 '14 at 21:27
  • doesn't work for me. it all started when i messed with https – Toolkit Mar 25 '16 at 13:31
10

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.

ArgisIsland
  • 407
  • 4
  • 9
  • 19
8

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.

charlesreid1
  • 3,871
  • 3
  • 28
  • 48
RobIII
  • 7,931
  • 1
  • 37
  • 85
  • @Roblll , I dont see Use IIS Express option when i right click on my MVC project in VS 2012, I saw that in VS 2010. I try to enable SSL for the solution in properties windows and It says property not valid. Moreever, In applicationhost.config file, I see multiple entries for my application like Webapplication(1), Webapplication(2), Webapplication(3) – DotnetSparrow Apr 08 '13 at 07:16
  • I had the same problem and overcame it by running VS2012 as admin (http://stackoverflow.com/a/13682315). I'm not too happy about that solution but I couldn't find any others. – brudert Apr 24 '13 at 15:54
  • In my project I noticed same port number was used for SSL and non-SSL. So I fixed that and the error went away. – orad Jan 22 '16 at 23:05
6

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.

splattne
  • 102,384
  • 52
  • 205
  • 248
Kerieks
  • 1,020
  • 6
  • 23
  • 51
  • I don't really now what I did to my solution, but also this was the only way I could fixed it. I even tried messing with the netsh command, deleting the IISExpress folder, start VS in Admin Mode and nothing else worked. I don't know where else the url:port get's mapped but taking other's project URL seemed the only solution for me. – Sergio A. May 06 '15 at 15:37
6

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
xameeramir
  • 25,752
  • 22
  • 132
  • 205
4

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.

deerchao
  • 10,262
  • 8
  • 52
  • 60
4

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

Ali Sadri
  • 1,442
  • 11
  • 14
3

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

xameeramir
  • 25,752
  • 22
  • 132
  • 205
RCanhestro
  • 41
  • 1
3

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.

Saroj
  • 526
  • 1
  • 5
  • 17
3

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.

Witcher
  • 1,020
  • 2
  • 14
  • 37
  • wowwwwww. This fixed in issue I've been working on for over 2 days. THANK YOU! What's odd in my circumstance is that every single project (75+) that this user has changed both settings to "true". I'm wondering how that happened - and also, is there a way to programatically change all projects? Or is there a visual studio setting that got messed up? – deebs Jul 02 '20 at 13:53
3
  1. Close all instances of Visual Studio.
  2. Open Task Manager.
  3. End all active IIS processes.
  4. Restart Visual Studio.
DMur
  • 509
  • 8
  • 24
2

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.

JimmyV
  • 433
  • 3
  • 11
2

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.

Amit Joki
  • 56,285
  • 7
  • 72
  • 91
hadi ab
  • 21
  • 1
2

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

luk2302
  • 50,400
  • 22
  • 92
  • 131
2

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.

fefferoni
  • 191
  • 2
  • 6
2

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.

Giles Roberts
  • 6,058
  • 6
  • 45
  • 61
2

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.

Anshuman Jasrotia
  • 3,079
  • 8
  • 45
  • 78
2

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.

Debashish Saha
  • 310
  • 1
  • 11
2

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.

2

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

Ali Sadri
  • 1,442
  • 11
  • 14
  • 2
    Tried to use applicationUrl of LAN (192.168...) some days ago. Later i changed all urls in .json file, but still was receiving error on IIS Express start from VS. In **applicationHost.config** i found with mentioned url, and removing it solved the problem. – miki Feb 25 '20 at 18:03
1

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.

Scott Decker
  • 3,929
  • 6
  • 22
  • 37
  • Should also add that the startup URL would need to be set, or set to "Current Page" or "Specific Page" -- at least checked. Mine was set to "Don't open a page. Wait for a request from an external application" and I had this error as a result, in addition to the startup project issue. – vapcguy Mar 18 '15 at 02:07
  • @Moumit did you down vote this? Can you explain your comment? – Scott Decker Nov 23 '15 at 14:55
1

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

user1161391
  • 121
  • 2
  • 9
1

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

Mohammad Dayyan
  • 20,033
  • 39
  • 154
  • 219
1

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.

Yasser Shaikh
  • 45,616
  • 44
  • 197
  • 276
1

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.
vapcguy
  • 6,573
  • 1
  • 50
  • 47
1

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.

spenibus
  • 4,279
  • 11
  • 25
  • 35
AndyKenZ
  • 41
  • 7
1

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.
Zeeshan Ahmad Khalil
  • 775
  • 1
  • 13
  • 26
0

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

xameeramir
  • 25,752
  • 22
  • 132
  • 205
0

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.

bguffey
  • 11
  • 1
    Why was this down voted? Seems like a completely plausible explanation for how to fix the problem. – dball Feb 25 '16 at 18:53
  • Unsure why anyone would have a typo like this in the `applicationhost.config`, unless someone that didn't know what they were doing was messing around. If it were an upgrade bug, I think it would be more profuse in the community that MS screwed up. I'm neutral as to if this is really a good answer. Something to try if all else fails, I guess, but certainly not where I'd start. – vapcguy Oct 14 '16 at 16:31
  • It can be a rare case for that file to be corrupt in this way, but I don't think anyone should down vote this. – Lex Li Jun 19 '17 at 00:58
0

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.

Pang
  • 9,073
  • 146
  • 84
  • 117
0

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.

MaxJ
  • 1,775
  • 2
  • 10
  • 19
0

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

Jacob Brewer
  • 2,428
  • 21
  • 25
0

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.

PVitt
  • 11,142
  • 5
  • 49
  • 84
tanuk
  • 441
  • 9
  • 8
0

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.

Ron DeFulio
  • 115
  • 7
0

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

Musakkhir Sayyed
  • 6,624
  • 13
  • 38
  • 62
0

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.

David van Dugteren
  • 3,596
  • 8
  • 32
  • 48
0

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

Or Change the port number

Nalan Madheswaran
  • 9,210
  • 1
  • 52
  • 39
0

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

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.

Aida Bigonah
  • 197
  • 10
0

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 !

yuvalchen
  • 133
  • 3
0

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>
Noel Lopes
  • 106
  • 6
0

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

SylvainB2347
  • 321
  • 3
  • 6
  • In my case this started happening all of a sudden, everything was fine a minute before and nothing had changed. I right-clicked the project > Build. Once that finished I tried to debug again and it worked. – Greg Mar 17 '20 at 11:42
0

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/

Adam Cox
  • 2,899
  • 1
  • 32
  • 37
0

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.

FoxDeploy
  • 11,508
  • 2
  • 30
  • 45
-1

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

Yehuda Shapira
  • 8,060
  • 4
  • 46
  • 66
relizondo6
  • 184
  • 5
-1

Make sure you run the VS as administrator! That will solve everything. Than me later.

MUHINDO
  • 83
  • 5
-4

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

Paul Roub
  • 35,848
  • 27
  • 79
  • 88