220

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

Beslinda N.
  • 3,683
  • 5
  • 20
  • 32

38 Answers38

421

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.

theyetiman
  • 7,447
  • 2
  • 26
  • 39
  • this is a great way to destroy a project – QBM5 Oct 24 '16 at 00:17
  • 1
    @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
  • 4
    'this problem seems to be caused by moving a project between workstations, environments, or versions of Visual Studio' - right reason and thanks for the solution. For me, I am started to face the issue when I did a fresh install of windows 10 – ModChowdhury May 20 '17 at 13:47
  • Worked on VS 2015, I thought when IIS Express Certificate operation still working, I interrupted process, and failed web project starts. deleting vs folder fixed. – Hamit Enes Sep 21 '17 at 19:44
  • 1
    probably the directory on the system.applicationHost/sites/site/application/virtualDirectory node of applicatoinhost.config is wrong. this solution works because it forces vs to rebuild it. – pomarc Nov 22 '17 at 14:30
  • I can not find the "folder of the solution", where or what is the folder? – Grim Dec 31 '17 at 11:10
  • 1
    @PeterRader the folder on the file system where the Visual Studio .sln file is located – theyetiman Jan 01 '18 at 15:47
  • 2
    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
  • After moving my project to different pc I got this error, after deleting .vs folder and hitting F5 the problem was fixed. +1 – yack Jan 22 '20 at 19:45
  • Thank you. This has been driving me nuts for days. After trying so many solutions, yours is the only one that worked. – Silent Fart Feb 09 '20 at 09:35
  • this works for me, note plural. none of the causes however apply to me. i wish there was a full list of causes so i can prevent this. every time i delete that folder, i lose my open tabs, and im getting tired of deleting that folder. sigh.. – Heriberto Lugo May 23 '20 at 19:04
233

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
Mayer Spitzer
  • 1,791
  • 12
  • 22
ali abid
  • 2,537
  • 1
  • 8
  • 6
  • 8
    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
  • 2
    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
  • dotnet core projects do not have these settings – Joe Phillips Jul 10 '18 at 18:45
  • 3
    This worked for me in VS2019. I tried repairing IIS, running VS as administrator, reboots, clearing .vs folder and fidgeting with windows environment varables among other things. But this was the solution that finally worked. – Magnus Svensson May 29 '19 at 12:01
  • 2
    This was the only thing working for me. But it makes me wounder, why on earth did this occur on a project i have opened like a hundred times ? – Andreas Sep 24 '19 at 03:53
  • I have been plagued by this issue recently! This worked VS2019 16.3.8. Prior to this reinstalled iisexpress via Web Platform installer rather than vs installer as the latter has too many dependencies tied to iisexpress. – Andrew Nov 13 '19 at 17:48
  • 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
  • I love you, you save my life and my job and my dignidade – Gabriel Berlanda May 21 '20 at 14:45
  • Worked for me! Thanks bro. I actually moved the project to a new laptop. – Sheikh M. Haris Jul 17 '20 at 21:02
  • ![wizard](https://i.kym-cdn.com/photos/images/newsfeed/000/117/814/are-you-wizard.jpg) – Kevin Heidt Sep 11 '20 at 00:29
  • Magnus Svensson i have done the same! ;-) – Carmine Checker Dec 15 '20 at 08:06
  • For me it was enough to unload and reload the project. – Cedervall Apr 09 '21 at 07:54
  • This is the only solution that worked for me (VS 2017). Thanks very much – Asela May 26 '21 at 05:26
  • Only working solution. – Amit Kumar May 27 '21 at 09:01
97

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!

Ahmad Aghazadeh
  • 14,753
  • 10
  • 88
  • 89
Juan M. Elosegui
  • 5,165
  • 3
  • 30
  • 41
  • 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
  • 7
    Rebooting VS did it for me (2013 Pro) – Pluc Aug 27 '15 at 11:42
  • 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
  • Restarting VS and running as admin resolved the issue for me. – Bat_Programmer Oct 05 '16 at 01:28
  • 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
  • I added the _CSRUN_DISABLE_WORKAROUNDS bit and that got me working. Thank you! – Rodney Ellis Aug 29 '19 at 00:08
  • Did you suggest that I should be running vs as admin from now on? – Anders Lindén Feb 11 '21 at 10:29
20

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
  • 827
  • 8
  • 7
19

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

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

Martin Staufcik
  • 5,801
  • 4
  • 32
  • 46
11

@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

Full Array
  • 663
  • 7
  • 9
10

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>
Manuel Alves
  • 3,263
  • 1
  • 25
  • 20
7

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
  • 3,857
  • 6
  • 29
  • 40
  • 3
    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
  • 2
    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
  • @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
6

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.

Alec Buchanan
  • 143
  • 2
  • 7
3

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.

EricksonG
  • 416
  • 3
  • 8
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

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.

lawphotog
  • 6,783
  • 19
  • 74
  • 121
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.

Hope this helps.

Roshna Omer
  • 497
  • 1
  • 12
  • 19
ransems
  • 505
  • 6
  • 13
  • 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
  • 30,672
  • 69
  • 32
  • 52
3

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,042
  • 1
  • 18
  • 41
  • 2
    Simply rebooting my PC did it for me, too! – khlr Jun 08 '20 at 05:56
  • 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
2

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

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
  • 7,342
  • 6
  • 61
  • 75
1

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

Min
  • 553
  • 4
  • 17
1

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
  • 516
  • 7
  • 27
1

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
  • 946
  • 1
  • 9
  • 23
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
  • 972
  • 7
  • 16
1
cmd - regedit-HKEY_LOCAL_MACHINE-SYSTEM-CurrentControlSet-Services-HTTP-START=3

Computer restarted.

worked for me!

eyllanesc
  • 190,383
  • 15
  • 87
  • 142
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.
klent
  • 522
  • 1
  • 11
  • 27
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

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.

F8ER
  • 404
  • 8
  • 18
  • 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
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

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

khalla
  • 3
  • 2
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
  • 40,814
  • 19
  • 140
  • 246
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,559
  • 4
  • 33
  • 57
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
  • 2,695
  • 1
  • 21
  • 16
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
  • 6,141
  • 1
  • 31
  • 28
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
  • 120,240
  • 73
  • 577
  • 618
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.

jmrpink
  • 270
  • 2
  • 11
0

In my situation Adobe was using the same port. After stopping the Adobe Creative Cloud Desktop process, VS functioned as expected.

0

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
  • 949
  • 2
  • 9
  • 25
0

I have the same problem. Here are some of the things I've done that haven't worked:

  1. Delete the .vs folder in my project
  2. Delete the IIS Express folder in My Documents
  3. Add _CSRUN_DISABLE_WORKAROUNDS to environment variable
  4. Restart the computer
  5. Restart Visual Studio
  6. Change the port
  7. Even re-install visual studio
  8. Uninstall IIS 10.0 Express via Control Panel, then reinstall

I've tried almost all the solutions I got from several forums and none of them have worked.

Finally 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 Control Panel. And follow the step by step contained in the following link

My Worked Solution

This is the only way that worked for me, and hopefully it will help the others too.