328

I am trying to run any program on visual studio 2013 update 3 and I get the following alert box:

Process with an Id of #### is not running.

Every time there is different ID number showing.

and in the error windows, I get this error message:

The program '[3148] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'.

Sometimes it runs and in the browser I get the following message:

The webpage is not available.

Why is this occurring and how can I resolve it?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Beslinda N.
  • 4,808
  • 5
  • 27
  • 33

46 Answers46

497

The following steps fix the problem for me:

  • Close Visual Studio
  • Navigate to the folder where your solution files are stored and delete the hidden .vs folder.
  • Restart Visual Studio
  • Hit F5 and IIS Express should load as normal, allowing you to debug.

Note: Based on my experience and others in the comments, this problem seems to be caused by moving a project between workstations, environments, or versions of Visual Studio. There must be some environment specific information contained in the .vs folder.

TylerH
  • 20,799
  • 66
  • 75
  • 101
theyetiman
  • 8,514
  • 2
  • 32
  • 41
  • this is a great way to destroy a project – QBM5 Oct 24 '16 at 00:17
  • 6
    @QBM5 how so? It might get rid of certain user settings and customizations but no code will be broken. Nothing you might have in version control would change. The `.csproj` remains intact. Plus, if it's in such a state that you cannot debug anyway, you've not got much to lose. – theyetiman Oct 24 '16 at 11:07
  • 3
    This basically worked for me for VS2017, but I was able to get away with just deleting the applicationhost.config file inside the vs folder in case this helps someone. – Steve Haselschwerdt May 02 '18 at 14:35
  • 1
    I am using VS2017 and just by deleting the file `/.vs//DesignTimeBuild/.dtbcache` I got it back on track. This avoids the whole `.vs` folder deletion which clears some VS2017 settings. – nrod Jun 11 '18 at 10:02
  • This worked for me but in combination with removing IIS Express folder as well – cozmin-calin Dec 04 '18 at 10:57
  • Not only does this answer still work now, it even worked for a whole different kind (Blazor) project. – Rich_Rich Mar 15 '23 at 13:05
  • Downgrading Visual Studio from 17.6 to 17.5 causes this issue. Deleting the `.vs`, `obj`, and `obj` did the trick. Thanks – Mark Davich Jun 05 '23 at 15:07
351
  1. Open Visual Studio as an administrator

  2. Right-click your project and click on 'Unload Project'

  3. Again, right-click your project and click on 'Edit PROJECT_NAME.csproj'

  4. Find the code below and delete it:

     <DevelopmentServerPort>63366</DevelopmentServerPort>
     <DevelopmentServerVPath>/</DevelopmentServerVPath>
     <IISUrl>http://localhost:63366/</IISUrl>
    
  5. Save and close the file .csproj

  6. Right-click your project and reload it

TylerH
  • 20,799
  • 66
  • 75
  • 101
ali abid
  • 3,745
  • 1
  • 10
  • 6
  • 18
    None of the other solutions worked for me but this. Doing the above will allow iis express to re-assign an open free port to run the web page in. Note: I wasn't able to rename the IISExpress folder because it said it was in use by myself (maybe a pc restart would have fixed it?). – goku_da_master Aug 25 '16 at 22:48
  • 4
    This worked for me with one extra step - after reloading the project I also had to right-click on it again and select "Set as StartUp project" before it would run. – John M Oct 21 '16 at 07:33
  • 4
    dotnet core projects do not have these settings – Joe Phillips Jul 10 '18 at 18:45
  • 1
    This works because it assigns the project a new port number. Using the previous port number will likely still fail. Your original port is locked up by another service. – Rob Mar 15 '20 at 03:21
  • For me it was enough to unload and reload the project. – Cedervall Apr 09 '21 at 07:54
  • 3
    This didn't work for me, I don't have DevelopmentServerPort in my csproj – DontFretBrett Jul 26 '21 at 02:13
  • In addition to this I had to go to the project Properties > Web and change the Start Action otherwise I was getting a Connection Error as it was attempting to navigate to the wrong port number. – Gibado Jun 28 '22 at 17:10
  • I tried most of the solutions out there and this one did it for me! Thank you @ali – Victor_Tlepshev Oct 05 '22 at 18:41
  • The settings can be found in the [projectName].csproj.user file, too. Could you add this in your answer? – kara May 22 '23 at 08:13
110

First Error

For the first error:

Process with an ID #### is not running.

The following steps worked for me:

  1. Close all instances of Visual Studio.
  2. Rename the IISExpress folder (in my PC is in C:\Users\jmelosegui\Documents).
  3. Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1. enter image description here
  4. Start Visual Studio in administrator mode. (In Windows, right click the executable file and select Run as administrator).

Second Error

The second error:

The webpage is not available

What caused this error:

I deleted IIS Express Development Certificate while playing with the SSL.

The following steps worked for me:

  1. Go to Control Panel.
  2. Select Add/Remove Programs.
  3. Locate IIS 8.0 Express.
  4. Right click on it then click Repair.
  5. Your certificate should be back!
TylerH
  • 20,799
  • 66
  • 75
  • 101
Juan M. Elosegui
  • 6,471
  • 5
  • 35
  • 48
  • 4
    I had to do the above, AND turn my computer off and on again (not just restart VS). – levininja Jul 17 '15 at 16:38
  • 6
    I simply renamed the IIS Express folder to something else. I didn't have to add the CSRUN variable. Step 1 & 2 was all I had to do. – AskYous Sep 02 '15 at 21:30
  • In regards to "Process with an ID #### is not running" error, i did not need to change any environment variables to solve this issue. I would try resolving this without the 3rd step. – JoshdeVries Aug 17 '16 at 20:29
  • Just renaming the IISExpress folder did it for me. There must have been something in the config that was borked. – Kinetic Sep 16 '16 at 09:47
  • 2
    I tried several options and the only one that worked is this one. IISExpess is recreated after doing this but I don't see any difference between both configurations.The difference is ./vs/applicationhost.config file is completely rewritten but it looks more like organization instead of something special. Looks like the variable does the trick. – Maximiliano Rios Oct 24 '16 at 15:51
  • 1
    One or two steps are missing in this. Please check the following url too. https://www.ryadel.com/en/process-id-not-running-visual-studio-2015-fix/ – Jeeva J Jul 19 '18 at 05:07
  • Works good with Visual Studio 2015. First two steps itself. Didn't have to go to the next line - The following steps worked for me: Close all instances of Visual Studio. Rename the IISExpress folder (in my PC is in C:\Users\jmelosegui\Documents). – RedBottleSanitizer Jun 24 '19 at 19:22
  • 1
    Did you suggest that I should be running vs as admin from now on? – Anders Lindén Feb 11 '21 at 10:29
  • `C:\Users\myusername\Documents` had an `IISExpess`, but renaming it didn't fix the issue. Then I realized actually there's another `IISExpess` folder in `C:\Users\myusername\OneDrive\Documents` where `Documents` was not in English, but in my system language - Russian, while there was yet another folder 'Documents' in English. Deleting the folder did it for me. – Artemious Oct 17 '21 at 22:09
  • For me other way worked: I removed the web project from solution and closed VS and re-opened it. the added project again to solution. this solved my problem – Javad Norouzi Sep 24 '22 at 00:18
  • There doesn't seem to be an official source for "_CSRUN_DISABLE_WORKAROUNDS". I think it's voodoo nonsense that does nothing at best. – The incredible Jan Nov 03 '22 at 10:56
24

With respect to the first error:

Process with an ID #### is not running

This situation will sometimes occur when IIS Express fails to bind to a port. A likely reason for that is that some other process has already bound to that port. Visual Studio will launch the IISExpress.exe process (which will fail to bind to the port and exit again) and then attach to the now-terminated process, resulting in the above error.

To check, note the port number in your project settings (e.g. 12116) and then try:

netstat -ano | find "12116"

If another process has the port open, this will give its PID. You can then choose to kill the offending process or reallocate your own port number.

uglybugger
  • 905
  • 9
  • 7
20

If you are using a 64-bit machine

Then the problem maybe due to Visual Studio use of 32-bit IIS-Express.

Solution: In Visual Studio, go to Tools menu > Options > Projects and Solutions > Web Projects > Enable the option "Use the 64 bit version of IIS Express" and click ok

18

My fix was simple, I was missing prerequisites. I needed to install .NET Core SDK

thatOneGuy
  • 9,977
  • 7
  • 48
  • 90
  • 2
    Me too, I had an old project targeting "netcoreapp2.2" in my csproj, found the installer online (wasn't listed on the VS installer because it's EOL) and the project ran immediately. – James Gould Jan 28 '22 at 13:38
  • This happened to me as well, even though I'd run the project before and didn't see any changes in the .csproj or .sln files - VS/msbuild suddenly started requiring the latest SDK – A N May 17 '22 at 15:14
  • me too, I had net6 SDK installed but the app was built on net5 – Stefan Vukovic Aug 28 '22 at 20:58
  • This solved my problem also. I had net core 6 and the project required net core 5. – Panagiotis Piperopoulos Nov 17 '22 at 16:14
  • Godo answer! This was my problem too (I hadn't installed the .NET 3.1 runtime). The error is not very clear! – Simon MᶜKenzie Mar 05 '23 at 22:26
15

I had the same problem. Just restarting Visual Studio worked for me.

Martin Staufcik
  • 8,295
  • 4
  • 44
  • 63
13

Another reason this can happen is for a .NET Core Web app if you upgrade the Microsoft.AspNetCore.Components.* NuGet package to a new version but don't install the new SDK,

In my case it was upgrading Microsoft.AspNetCore.Components.WebAssembly from 6.0.0 to 6.0.1 and didn't install .NET 6.0.1 SDK

dbmuller
  • 318
  • 4
  • 7
9

Kilanny's answer is correct. Most machines in 2015 are 64bit, so there's a lot of chances that you just need to enable the 64bit option under the Tools main navigation link menu. No need to configure other files or hard code ports. Besides, port assignment should be dynamic. This fix applies to 2013 With Update 3 and Visual Studio 2015 Community Edition.

Check the images below for a mini tutorial: (I'm just improving Kilanny's answer)

Visual Studio Tools Menu

Visual Studio Web Project Options

TylerH
  • 20,799
  • 66
  • 75
  • 101
Full Array
  • 769
  • 7
  • 12
8

It looks like there are many solutions that work and some that don't...

My issue kept surfacing after a few test iterations. Yes restarting the PC and/or VS would resolve the issue...but temporarily.

My solution was to undo a security change I had enabled a couple days earlier to Controlled folder access under Ransomware protection.

I undid this change by:
(right click Start) Setting->Update & Security->Windows Security->Virus & threat protection-> Virus & threat protection settings->Manage settings

Under Controlled folder access Click->Manage Controlled folder access (this is also the Ransomware protection screen)

Turn Controlled folder access off.

This was 100% the issue for me as I was able to run my test without restarting VS.

Chris Catignani
  • 5,040
  • 16
  • 42
  • 49
  • 4
    I know you answered a long time ago, but your solution has finally resolved my issue. After playing around with all the other "solutions", turning off Controlled folder access resolved the issue. I took this one step further and instead of totally turning this off, I clicked the Allow an app through Controlled folder access and added an allowed app, selecting iisexpress.exe – Jeff Hopper May 14 '19 at 18:54
  • 3
    A further note on this - you can be a bit more granular and just add IIS Express to the "allowed apps" in ransomware protection. – mutex Jul 18 '19 at 21:03
  • 1
    @mutex I'm gonna revisit this after your comment ...I did notice that I has added ISS Express that last time! I'm going to recreate the problem and see if I can nail it down a little more. – Chris Catignani Jul 19 '19 at 13:46
5

I had a similar problem with Chrome. It appears that VS can't attach to the Chrome process for some reason.

Solution:

  1. Close Chrome
  2. With Chrome closed, start the web project and allow VS to open Chrome.
TylerH
  • 20,799
  • 66
  • 75
  • 101
EricksonG
  • 472
  • 4
  • 10
5

My solution to this on a new machine and fresh install of VS 2022 was to install the 3.1 framework. So check to make sure whatever framework the project is expecting is installed on your local machine.

JIntro
  • 656
  • 9
  • 19
4

go to Properties of the start up project, increment port number of the Project Url is probably the quickest way to get around this problem which I didn't read anyone mentioned yet.

And you don't need to restart VS as it can be a pain sometimes if you needed a few other instances needed to be running.

Laurence
  • 7,633
  • 21
  • 78
  • 129
4

Reboot your computer before trying any of these!

Some of these may be helpful. Doing the netstat trick

netstat -ano | find

helped me as another application was using my port, but didn't completely solve my problem. IIS Express still kept crashing. It wasn't until I rebooted my win 10 PC (first time in over a week), that my problem completely cleared up.

Dan Csharpster
  • 2,662
  • 1
  • 26
  • 50
  • 1
    For me, begin by looking for the simplest, least destructive solutions first. I checked restart, and I had a pending windows update ready to install. When I updated (through restart) it then worked fine for me. – PTK Apr 10 '21 at 12:39
  • 1
    I had to do multiple reboots, eventually worked. Advice: maybe try two before trying other solutions. – JosephDoggie Aug 31 '23 at 21:30
4

I encountered this while trying to run a project I'd run many times on a machine I'd used for the project many times. Cleaning up my IIS Express directory and my .vs directory didn't work, nor did setting environment variables. I even tried re-cloning my repository to a different folder, but no success.

By trying to run via command line, I found a more useful message:

dotnet run --project [startup project path]

I saw that the project was trying to run using .NET 6.0.5, but I only had .NET 6.0.4 installed. Installing the latest .NET 6.0.5 from the Microsoft website worked.

A N
  • 276
  • 5
  • 18
  • Before you all trying other solutions try this. I had .net core 3.1 app and after fresh vs 2022 install i did not install unnecessary packages. I just only installed .net 6.0. But I could not open my app and it did not give me proper message. So i just install .net core 3.1 and it fixed. – Hakkı Jun 13 '22 at 11:09
3

For me, none of the other solutions worked. The things I tried:

  • Updating and patching everything associated with Visual Studio
  • Reinstalling Visual Studio
  • Reinstalling IIS Express
  • Several reboots
  • Adding the _WORKAROUND thing to the PATH
  • Renaming the IIS folder under documents to regenerate the IIS config
  • Manually editing the csproj file and removing the whole IIS settings section
  • Changing the IIS executable usage to 64bit in VS settings
  • Changing the port of IIS in the projects settings

After checking if the problem was persistent over different projects, it turned out that the problem only occurred in one specific projects. I figured that I had to delete all the user specific files in the solutions folder (such as bin, obj, *.suo, ...) I just deleted the whole solution folder and reverted the files in git.

TLDR: Try deleting user specific files/folders like bin, obj, *.suo, ...

Fabian B
  • 31
  • 3
3

Head to the following directory

%userprofile%\documents\IISExpress\Config directory

Delete all files within that folder. Restart visual studio and works like a charm.

TylerH
  • 20,799
  • 66
  • 75
  • 101
3

I had the same problem, and what needed to be done was setup IIS Express properly.

I right clicked on my project Properties => Web (tab) and on Servers: Project URL was already pre-populated and I clicked the button "Create Virtual Directory".

I had just reinstalled (refreshed) windows and the IIS was not setup b/c it was new.

TylerH
  • 20,799
  • 66
  • 75
  • 101
ransems
  • 641
  • 7
  • 19
  • 1
    This worked for me - I actually changed it to a different port number as well and then was prompted to "Create Virtual Directory". That seems to have done the trick. – AVH Jan 31 '19 at 20:25
3

Close VS. Navigate to the folder of the solution and delete the hidden .vs folder. Restart VS. Hit F5 and IIS Express should load as normal, allowing you to debug.

If this not working, then:

  1. right click your solution and go to properties

  2. Click left menu Web tag

  3. Click checkbox "Override application root Url"

and run again your project.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
2

I also had the same problem, doing the above didn't work for me. What my error turned out to be was twofold.

  1. I had Opera as my default browser and it couldn't attach to that.
  2. I had multiple startup projects so it wouldn't let me switch to IE until I change the default startup project back to just the MVC shell.

I set that project specifically as the startup, then I switched it back to launching IE and it started debugging again.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Min
  • 593
  • 4
  • 17
2

I came across the same problem and found that somehow the file 'applicationhost.config' (in ..\Documents\IISExpress\config) had a different localhost port number (in the 'sites' section) to the one specified in project\properties\web. Changed them to the same number and the problem went away

quilkin
  • 874
  • 11
  • 31
2

What I did to make this go away:

Open C:\Users\gr_mext1\Documents\IISExpress\config\applicationhost.config and remove all <site> entries in <sites> do not remove <siteDefaults>!

In your project, go to Properties, Web and click "Create Virtual Directory".

Close and re-open visual studio, load your project and run

Fixed!

Nebula
  • 1,045
  • 2
  • 11
  • 24
2

For me this was the solution,

  1. Close all running Visual studio instances
  2. Open the solution folder and remove the .vs folder (hidden folder)
  3. Open Run Command
  4. Type iisreset and press Ok, and you may see a command prompt and wait for it to complete and it will close automatically

Now Open visual studio and run your project, it should run.

2

So, nothing worked for me and this happened to happen to me when I got a new machine. Apparently it didn't have the older versions of .Net on it. Went into VS Installer and checked the box for .Net 5 Runtime (VS 2022). Working fine now on all .Net 5 Projects.

Kylar182
  • 79
  • 1
  • 7
  • 1
    In my case this issue reproduced after I uninstalled vs 2019 and installed vs 2022, by adding .net 5 runtime the issue was fixed the issue, thx a lot ! – Alex Mar 10 '22 at 18:18
2

TL;DR: if you do have the right .NET Core (or .NET I guess) runtime installed, install any patch updates or reinstall the latest version if there aren't any.

Detail: Similar to a couple of other answers where they just didn't have the right .NET core installed. I was trying to run a .NET Core 3.1 web app which had worked fine previously for months, and this suddenly started happening.

I did have 3.1 (runtimes 3.1.21 and 3.1.22) installed. However a new one (3.1.23) had been released 12 days earlier, and installing that fixed the problem.

I have no idea if this was because it's aware that there's a new patch and I didn't have it so it wouldn't run, or if there was just something wrong with my 3.1.22 installation. Worth trying installing latest patch, or reinstalling existing installations.

jsabrooke
  • 405
  • 7
  • 12
2

In my case I had to update Visual studio 2022 from Visual Studio Installer. I was using Blazor and .Net7 and the blazor app wouldn't launch. By the way, I will add, remember to update the SDK, and the blazor if it concerns you.

Troom
  • 431
  • 6
  • 10
1

None of the listed solutions worked for me. Problem was some sort of conflicting state in local applicationhost.config file. Fix is easy, just delete one in your solution. For VS2015 it should be located in <path_to_your_solution>\Solution\.vs\config\. When you launch Debug, VS will recreate that file based on settings in your project file.

Sherlock
  • 1,022
  • 8
  • 19
1
cmd - regedit-HKEY_LOCAL_MACHINE-SYSTEM-CurrentControlSet-Services-HTTP-START=3

Computer restarted.

worked for me!

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
1

Deleting the hidden .vs folder didn't work for me since the port specified in my app was being used by another app. Doing the following worked for me:

  1. Went to properties and then click the web tab.
  2. Changed the port number in the Start Url and the Project URL.
  3. Clicked Create Virtual Directory.
  4. Save and Press F5.
Len
  • 534
  • 1
  • 15
  • 31
1

Tried most of the things here to no avail, but finally found a fix for my machine, so thought I'd share it:

Following previous advice in another question, I had used netsh to add :: to iplisten. It turns out undoing that was my solution, by simply replacing add in their advice:

netsh http delete iplisten ipaddress=::

You can also do this manually by deleting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList from the registry and restarting the service/your PC.

StormFoo
  • 1,129
  • 2
  • 10
  • 25
1

I update my Visual Studio to 2019 version and has this problem, I tried all solution from this question but it doesn't help to start my ASP.NET MVC 5 project with IIS Express. After I remove IIS Express (using Control Panel), download last version from www.microsoft.com and install it. After this everything works fine.

After some weeks i got update for Visual Studio and I got this problem again. I remove IIS Express and reinstall and it works fine now. p.s. repair didn't help me, only uninstall and install.

1

I had a similar issue, but mine was the presence of deleted image files in the drive.

I removed it, deleted .vs hidden folder, now it works

Arun Prasad E S
  • 9,489
  • 8
  • 74
  • 87
  • What does this add over the top answer, which already instructs the user to delete the .vs folder? – TylerH Aug 03 '22 at 15:33
  • @TylerHcheck the accepted answer, its different. – Arun Prasad E S Aug 06 '22 at 17:44
  • I did check the accepted answer and I don't see a difference so I am asking you, the author, to clarify what is different. The accepted answer says to delete the hidden `.vs` folder. This answer also says to delete the hidden `.vs` folder. There doesn't seem to be a difference there. – TylerH Aug 08 '22 at 13:33
  • @TylerH check this, this is the accepted answer https://stackoverflow.com/a/27155236/5237614 – Arun Prasad E S Aug 08 '22 at 14:58
  • 1
    Sorry, the _top_ answer, shown first when ordered by score (the default). Which is what my first comment specified. – TylerH Aug 08 '22 at 16:31
1

Found the solution!

I had something similar:

The main problem was Start registry entry located at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP

The solution: change the value of Start key from 4 to 3 and reboot.


Tired the following, yet there was no success:

  1. Reinstall the whole VS2019 web development environment;
  2. Delete %userprofile%\Documents\IISExpress;
  3. Delete .vs folders;
  4. Remove IIExpress 10 from Programs in Win10;
  5. Change various project settings/properties.

One of the possible issue sources I recall is running Laragon which required to change this value to 4 in order to start an Nginx web server.

Artfaith
  • 1,183
  • 4
  • 19
  • 29
  • This was the issue I had. I had disabled it to unblock port 80 and then a week later was completely stumped by why IIS wouldn't launch. Sadly this was on page 2 and I didn't notice it until after figuring it out. I'm upvoting so hopefully others won't suffer. – Hedzer Mar 10 '21 at 22:59
1

I found the source of the problem. The source of the problem is not from my project nor from my visual studio, but from my IIS.

When I open iisexpress.exe from C:\Program Files\IISExpress, the command prompt closes immediately. If your IIS Express is fine, then what will appear is as shown below.

iisexpress.exe if success

What I do is reset or reinstall IIS Express via "Turn Windows Features on or off" in the Control Panel. And follow the step by step instructions contained in the following link

Answer to IIS w3svc error

TylerH
  • 20,799
  • 66
  • 75
  • 101
Ruddy Cahyanto
  • 103
  • 1
  • 6
  • In my particular scenario changing the port sufficed. Perhaps this should be the first option before reinstalling the entire IDE. – jorge cordero Dec 29 '21 at 01:12
1

I ran the command :

dotnet --list-sdks

I saw I had a slightly older SDK than what I had set up inside the .csproj file. So I downloaded the latest .net 6 SDK and closed and reopened Visual Studio. The solution finally started up.

Tore Aurstad
  • 3,189
  • 1
  • 27
  • 22
1

Restarting Your PC worked for me. Try that first before messing with a bunch of other stuff/settings.

Joel Youngberg
  • 444
  • 1
  • 8
  • 7
0

I recently had the same issue with VS 2013 and IIS Express:

"Process with an ID #### is not running ." // every time there is different ID number showing.

Here was the solution I found that worked for me:

1) Go into the Documents -> IIS Express -> config -> applicationhost.config

2) I opened applicationhost.config in Notepad++

3) Under the tag , there are lines of code that looks like this:

    <add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true">
                 <processModel loadUserProfile="true" />
        </add>

4) Remove these two lines

                <processModel loadUserProfile="true" /> 
        </add>

5) Change the END of the first line to

            <add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />

Notice that all I did was close the tag by adding ' /' after "true".

I am now able to run my projects in a web browser AND debug my code.

Also, I had updated to Update 4, but was having the same issue. I believe appending the applicationhost.config file was what fixed the problem.

I hope this helps!

bgibbs17
  • 1
  • 1
  • I forgot to mention, I tried all of the other options posted on this particular question and many other I had found on other forums and sites. None of them worked. – bgibbs17 Jun 25 '15 at 17:04
0

This can happen for various reasons, helpfully - if you run IISExpress.exe (\Program Files (x86)\IISExpress\iisexpress.exe for 32-bit, \Program Files\IISExpress\iisexpress.exe for 64-bit) in the command line, you'll get some more details. In my case:

C:\Program Files\IIS Express>iisexpress.exe

Filename: \\?\C:\Users\My.Username\Documents\IISExpress\config\applicationhost.config
Line number: 15
Error: Configuration file is not well-formed XML

Nice and easy to fix, that one my was my fault though!

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
RDutton
  • 1
  • 2
0

For me, VS uses Firefox for the default browser. Restarting VS and closing all Firefox windows seems to resolve this issue.

PhillyNJ
  • 3,859
  • 4
  • 38
  • 64
  • This is a duplicate of https://stackoverflow.com/a/28748273/7758804. There doesn't need to be a "restart VS" for every OS and browser. – Trenton McKinney Aug 03 '22 at 20:36
0

If you're using git as source control, you should also make sure that any user specific files are ignored.

[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

If they're already tracked, then use git -r rm --cached

This resolved the error for me.

Greg R Taylor
  • 3,470
  • 1
  • 25
  • 19
0

startMode="alwaysRunning" in $SOLUTION_DIR/bis/.vs/config/applicationhost.config caused it for me. Try to remove that string and everything will work again (even without restart of VS)

lukyer
  • 7,595
  • 3
  • 37
  • 31
0

Close your instance of Visual studio. Start it again in Administration mode. "Run as Admin"

0

Running as administrator didn't seem to make a difference when I got this.

  • Make sure all iisexpress.exe processes had been closed
  • Edit <path_to_your_solution>\Solution\.vs\config\applicationhost.config
  • Change the site name.

    <site name="MySite" id="1" serverAutoStart="true">

    to :

    <site name="MySite2" id="1" serverAutoStart="true">

  • That fixed it for me
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
0

What fixed it for me was running the project from a different file in my solution. Specifically, 2 of my files are named web.config, so I just ran from the other one.

Catlover
  • 379
  • 2
  • 16
0

I had similar issue because of IIS Express being installed under Documents and Documents folder was synced with One Drive. Deleted .vs folder and reinstalled IIS Express. Before installing IIS Express, delete IIS Express folder after uninstall.

BSave
  • 11
  • 4
0

For me, I deleted the .vs folder and restarted vs, and it didn't work. After restarting my laptop it worked again.