Unable to launch the IIS Express Web server
Asked Answered
B

54

357

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.

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 cannot debug the code. how to get rid of these errors and debug/run the web site from VS 2012?

Betulaceous answered 8/4, 2013 at 7:3 Comment(3)
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: riii.nl/apr5u, a step-by-step guide by Hanselman himself!Cyanocobalamin
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.Cyanocobalamin
@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 localhost:44300 ? I am using IIS express 8Betulaceous
A
445

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"
Alfredalfreda answered 11/6, 2013 at 7:13 Comment(15)
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.Agamemnon
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).Unscrupulous
I had 'cannot read configuration file' errors after doing this. See #15898226Slav
Thanks. Just don't forget to close then re-open VS for it to reconfigure the IIS Express.Success
I did that and it's not work for me then I restart the PC then all work calm.Colugo
This fixed this error and a problem I was having with website projects being renamed to something other than their directory name (detailed here).Hyphenate
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.Mcgaha
Recreating the virtual directory worked for meBronson
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.Transmit
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.Petrarch
@Petrarch has the answer for VS2015 Update 3. Navigate to the ".vs\config" folder in the solution directory and delete the "applicationhost.config" file there.Bearded
I also had to close my browser windows that were running the app.Alejandro
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 blog.lextudio.com/… and I welcome all feedbacks.Marroquin
Try to delete the .vs folder in project If someone still didn't work after doing it and restart the computer,Lungan
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!Bowse
B
252

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

Biconvex answered 4/3, 2016 at 15:29 Comment(8)
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!!!Deepsix
work on VS 2915 @mihail i didn't delete anything, just create virtual directory ... what does it need for ?Dang
@AbdouTelb check this out iis.net/learn/get-started/planning-your-iis-architecture/… 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 :)Biconvex
Deleting the applicationhost.config under the .vs/config directory worked in VS2015.Flinn
Make sure iisexpress is actually not running when you delete the config file.Biconvex
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:'.Shinleaf
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.Implead
@Implead 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.Biconvex
S
85

@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

Selffertilization answered 16/7, 2013 at 23:45 Comment(3)
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!Synn
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.Housefather
Btw, if you have both http and https bindings, make sure you're not using the same port number on both of them.Lukasz
M
44

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.

Muster answered 25/3, 2014 at 12:28 Comment(0)
L
25

Try the following steps:

  1. delete the IISExpress folder as @Yehuda Shapira said
  2. restart computer
  3. delete the .vs folder in project
Lungan answered 7/9, 2017 at 2:30 Comment(2)
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.Transpontine
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.Whip
S
19

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

Scientist answered 7/4, 2015 at 17:31 Comment(3)
Unfortunately this didn't help me.Elwell
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.Blackdamp
Maybe some update was installed with administrator rights and since then it wouldn't work without admin privileges anymore.Scientist
R
16

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

Reconstructionist answered 15/1, 2014 at 11:25 Comment(0)
Q
14

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.
Quadratic answered 6/5, 2014 at 9:11 Comment(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.Squabble
doesn't work for me. it all started when i messed with httpsEvanish
S
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!

Salpingitis answered 22/7, 2015 at 1:5 Comment(0)
C
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.

Cruelty answered 21/1, 2014 at 17:58 Comment(0)
O
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.

Orelee answered 8/10, 2014 at 9:41 Comment(0)
B
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
Bronson answered 8/12, 2015 at 16:34 Comment(0)
L
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.

Lastex answered 20/12, 2013 at 9:38 Comment(0)
S
4
  1. Close all instances of Visual Studio.
  2. Open Task Manager.
  3. End all active IIS processes.
  4. Restart Visual Studio.
Staircase answered 8/5, 2020 at 15:37 Comment(0)
P
3

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.

Petey answered 11/8, 2014 at 14:59 Comment(0)
D
3

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.
Denoting answered 9/10, 2014 at 12:20 Comment(0)
P
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.

Phenformin answered 11/12, 2019 at 14:22 Comment(1)
Where do i go to "Edit project in solution"? I looked all over an ASP.NET web solution in Visual Studio for something like this and could not find anything like it.Psilocybin
D
2

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.

Denning answered 6/9, 2013 at 18:40 Comment(1)
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.Mcgaha
W
2

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

Whore answered 16/12, 2013 at 12:21 Comment(0)
H
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.

Hobgoblin answered 12/2, 2015 at 12:7 Comment(0)
H
2

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

Hoe answered 14/4, 2015 at 11:34 Comment(0)
O
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.

Octal answered 8/6, 2015 at 14:44 Comment(0)
D
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.

Douville answered 4/1, 2016 at 10:35 Comment(0)
P
2

In my case my applicationhost.config file was somehow missing the following two lines 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" />
Planimetry answered 24/8, 2016 at 15:6 Comment(0)
D
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.

Dunc answered 20/5, 2018 at 18:59 Comment(0)
V
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

Vizor answered 13/2, 2020 at 10:57 Comment(1)
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 <binding> with mentioned url, and removing it solved the problem.Vaulted
R
2

Right click on the project at solution explorer enter image description here

tab Web and Press the Create Virtual Directory

enter image description here

Ruralize answered 5/12, 2022 at 15:14 Comment(0)
G
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.)

Gout answered 26/3, 2014 at 21:8 Comment(0)
I
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

Incorruption answered 29/8, 2014 at 15:13 Comment(0)
P
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.

Provided answered 4/3, 2015 at 11:39 Comment(0)
M
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.
Mcgaha answered 18/3, 2015 at 2:13 Comment(0)
C
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.

Calendar answered 16/9, 2015 at 13:23 Comment(0)
R
1

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.

Regulus answered 11/9, 2018 at 9:26 Comment(2)
This doesn't add anything new to the existing answers.Psilocybin
TylerH there is no older comment with 1. restart visual studio and 2. restart your systemRegulus
K
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.
Khalil answered 17/7, 2020 at 14:2 Comment(0)
C
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

Christianson answered 7/2, 2015 at 13:38 Comment(0)
G
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.

Guadiana answered 19/6, 2015 at 16:26 Comment(3)
Why was this down voted? Seems like a completely plausible explanation for how to fix the problem.Gwendolyn
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.Mcgaha
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.Marroquin
L
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.

Leakey answered 4/11, 2015 at 7:2 Comment(0)
U
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.

Unstopped answered 26/8, 2016 at 12:45 Comment(0)
H
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.

Hardcastle answered 18/5, 2017 at 10:35 Comment(0)
D
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.

Dunn answered 15/6, 2017 at 3:21 Comment(0)
H
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

Heathheathberry answered 11/8, 2017 at 9:1 Comment(0)
S
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.

Siriasis answered 18/9, 2017 at 5:8 Comment(0)
C
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

Conspire answered 2/3, 2018 at 0:42 Comment(0)
K
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> 
Krissykrista answered 12/3, 2019 at 19:35 Comment(0)
H
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.

Hostile answered 18/4, 2019 at 4:3 Comment(0)
G
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 !

Glantz answered 22/7, 2019 at 17:46 Comment(0)
D
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>
Desjardins answered 9/9, 2019 at 10:4 Comment(0)
A
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/

Allgood answered 14/1, 2020 at 16:2 Comment(0)
A
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.

Ardor answered 5/2, 2021 at 15:57 Comment(0)
R
-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

Rath answered 1/8, 2014 at 22:14 Comment(1)
The problem is iis express not local iisGreenock
B
-1

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

Brassware answered 4/1, 2017 at 14:41 Comment(0)
H
-1

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

Handspike answered 13/12, 2019 at 9:38 Comment(1)
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.Keffiyeh
S
-1

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

Strode answered 27/5, 2022 at 17:12 Comment(0)
Y
-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".

Yakut answered 14/12, 2015 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.