44

Occasionally when running my MVC4 site in VS2012 using IISExpress I get the following error and IISExpress stops:

iisexpress.exe: Managed (v4.0.30319)' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified

There is nothing in the event log for this and I cant find anything on the interweb.

I have some very vague theories:

  • my site is using MEF a loads modules dynamically at startup. Maybe there is an occasional race condition so IIS cant open an assembly but my trace logs show that IIS is beyond that part of the startup cycle.
  • it also has SignalR but apart from starting the hub it's not doing much yet. SignalR is pretty new and unproven but I've updated the latest RC2 version with the same result.

Oh and I also had the same error when using the VS Dev web server. I havent tried full IIS yet.

Anyone else go a clue ??

Thanks

UPDATE:

I fixed a couple of nuget references which seemed to stabalize things a bit, then this morning it happened again. The VS output window shows this:

'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mobile\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\peter.jones\AppData\Local\Temp\Temporary ASP.NET Files\root\a4aa93f7\dfa23a50\App_Web_rpzlbjhw.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\peter.jones\AppData\Local\Temp\Temporary ASP.NET Files\root\a4aa93f7\dfa23a50\App_Web_c1rjct4s.dll', Symbols loaded.
The program '[11072] iisexpress.exe: Managed (v4.0.30319)' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'.

If there is some more useful logging somewhere I will happily provide it.

Cheers

Jonesie
  • 6,997
  • 10
  • 48
  • 66
  • Do you have one of the below Windows update installed on the machine?(support.microsoft.com/kb/2750149 for windows 8 and support.microsoft.com/kb/2750147 for Windows 7 platform.) – Anand Feb 11 '13 at 17:42
  • No, I dont have that installed. Will try, but why do you think this will help? I cant see anything in the readme about IIS or the error number. – Jonesie Feb 11 '13 at 19:10
  • Can you please email us a small repro at netfx45compat@microsoft.com? Did you try attaching debugger to iisexpress before it crashes and see if you can get a stack trace? – Anand Feb 13 '13 at 01:16
  • If I could get it to fail predicably then I would be happy to do this but currently, it happens seamingly randomly. – Jonesie Feb 14 '13 at 01:56
  • Can you try the same in IIS? Enable Failed Request trace logging in IIS to capture errors. http://technet.microsoft.com/en-us/library/cc725786(v=WS.10).aspx – Anand Feb 14 '13 at 02:06
  • I also get this error sometimes. I´m working with VS2012 and develop a silverlight+wcf ria services application. – Jehof Mar 15 '13 at 08:55
  • My feeling is that this may have something to do with MEF (Composition) but I have no evidence for this... just a hunch. – Jonesie Mar 16 '13 at 17:59
  • 2
    I'm not using MEF or SignalR but am also seeing this behavior. – Doug Wilson May 15 '13 at 15:28
  • 2
    Using MVC4 and VS 2012 I get the same from time to time. I just attribute this behaviour to Microsoft's way of doing things, ==> [] – Shautieh Jun 07 '13 at 15:07
  • Have tried installing the Windows 8 update above (support.microsoft.com/kb/2750149) - problem still persists using MVC4 and VS2012. – James Allen Jun 13 '13 at 09:48
  • may be you have other web servers running on your machine ? – sino Jul 24 '13 at 13:47
  • No other web servers installed. I've got a brand new machine without IIS installed and it still happens. 2 other devs in my team have the same problem also (with and without IIS installed). We've also updated to VS12 Update 3. – Jonesie Jul 24 '13 at 19:41
  • you don't happen to be using Trusteer Rapport on your network do you? That security app has known issues with IIS and the VS Debugger – Claies Jul 27 '13 at 14:44
  • I'm getting the exact same problem but in a WebForms application in VS2015 (.NET 4.6). Occasional drops after starting the debugger. Happens 2-3 times a day; one in 30 starts of debug sessions. `The program '[16736] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'.` – Chris Walsh Nov 01 '16 at 16:35

3 Answers3

2

vs2013 -> tool -> option -> project & solution-> web project -> cancel use IIS Express 64

Hope this can help you!

Ruan
  • 132
  • 6
  • Not sure why this is downvoted... [this answer](http://stackoverflow.com/a/30455257/945456) on similar question has several upvotes (although I guess it's the opposite situation though: checking vs unchecking). – Jeff B Jun 30 '16 at 22:14
  • +1 Yeah, this fixed my problem but in the reverse direction. This maybe should be the selected answer. Thanks @Ruan. – Jordan Apr 12 '18 at 15:33
1

Enable Failed Request trace logging in IIS to capture errors

link here

and you can get more information about the thread on IIS forums

Good luck!

Dmitry
  • 79
  • 1
  • 2
  • 9
1

This appear to be an occurrence in VS from VS2010 onwards and the Cannot run program using debugger has a reference to particulat error number and exception 0xC0000008 mentions the particular exception.

This link AjaxControlToolkit Error with PopupControlExtender also references both the Exception and error number at the bottom of the second stack trace and the OP went on to resolve the issue.

All the links / recommendations and links to the MS connect log for the fault. Hope this can help you get a little bit further along in your quest for an answer.

Code Uniquely
  • 6,356
  • 4
  • 30
  • 40