228
votes

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

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

and in the error windows I get this error msg:

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.

I have looked around and try almost everything and I stil cannot fix the problem.

Please help anyone

30
I had this problem because Fiddler was running.Shelby115
For me, closing all instances of VS did the trick.Radu Cojocari
I solved by deleting the .vs/config/application.config file under VS project folderMarcello
Ran into this when changing the default browser to Internet Explorer on Windows 10 and using Visual Studio 2015. Switching back to the Microsoft Edge browser solved it for me.Kristian
This can also happen in Visual Studio 2019 too...Chris Catignani

30 Answers

98
votes

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!

Hope this helps!

434
votes

The following steps fix the problem for Visual Studio 2015 and Visual Studio 2017:

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

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.

241
votes

Easily solved:

  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
  7. See its working
20
votes

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.

19
votes

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

15
votes

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

11
votes

@Kilanny your 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

10
votes

I found the solution here:

https://www.codeproject.com/Tips/1029540/Solved-Process-With-An-Id-Of-Is-Not-Running

Edited the project file and deleted the lines:

<DevelopmentServerPort>xxxxx</DevelopmentServerPort>
<DevelopmentServerVPath></DevelopmentServerVPath>
<IISUrl>http://localhost:xxxxx/</IISUrl>
8
votes

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.

7
votes

I tried the first error and that didn't help me. However What did work for me was to delete the hidden ".vs" folder which is at the solution root.

4
votes

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.

Hope that helps.

3
votes

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

3
votes

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.

3
votes

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.

Hope this helps.

3
votes

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.

3
votes

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.

2
votes

Resolution I found;

Head to the following directory

%userprofile%\documents\IISExpress\Config directory

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

2
votes

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

1
votes

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.

Hope that helps

1
votes

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

1
votes

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!

1
votes

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.

1
votes

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.
1
votes
cmd - regedit-HKEY_LOCAL_MACHINE-SYSTEM-CurrentControlSet-Services-HTTP-START=3

Computer restarted.

worked for me!

1
votes

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
votes

Found the solution!

I had something similar:

It took a while to figure this out. Have tried:

1. Reinstalling the whole VS2019 web development environment
2. Deleting `%userprofile%\Documents\IISExpress`
3. Deleting projects' `.vs` folders
4. Removing `IIExpress 10` from `Programms` in Win10
5. Changing projects' settings/properties

The main problem was a registry entry Start located at

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP

So, changing value of a key Start from 4 to 3 and rebooting fixed the issue.

One of possible reason I would recall is running the Laragon which required changing this value to 4 to start an Nginx web server.

0
votes

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!

0
votes

Same error Process with an ID #### is not running using visual studio 2015 RC.

Only go rid of the message after repair IIS 10 in Control Panel - Programs and Features

Renato

0
votes

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!

0
votes

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