Workaround for IIS Express Crashing
Join the DZone community and get the full member experience.Join For Free
i ran into this weird issue when developing a very simple windows azure cloud service web role using windows azure sdk 1.8 . i started off with a basic asp.net mvc 4 web role with no changes whatsoever. when i tried to debug it with just one instance running, everything worked great. the moment i increased the number of instances to 2 (or more than 1) and tried to debug it, iis express crashed with the following entries in event logs:
faulting application name: iisexpress.exe, version: 8.0.8418.0, time stamp: 0x4fbae3d6
faulting module name: ntdll.dll, version: 6.2.9200.16420, time stamp: 0x505ab405
exception code: 0xc0000008
fault offset: 0x0000000000004c39
faulting process id: 0x54bc
faulting application start time: 0x01cdfeb70c1e060e
faulting application path: c:\program files\iis express\iisexpress.exe
faulting module path: c:\windows\system32\ntdll.dll
report id: 4a8f54b2-6aaa-11e2-be81-9cb70d025a13
faulting package full name:
faulting package-relative application id:
fault bucket 79240842, type 4
event name: appcrash
response: not available
cab id: 0
these files may be available here:
rechecking for solution: 0
report id: 4a8f54b2-6aaa-11e2-be81-9cb70d025a13
report status: 17
hashed bucket: b615b24f7933990317ae65713d680dab
this issue does not happen on all machines . i asked a few of my friends to try on their computers and some of them were able to recreate this problem while others couldn’t. my development environment was windows 8 , visual studio 2012 and windows azure sdk 1.8 .
since i was facing this problem and a few of my friends are also facing the same problem, i thought there may be many more folks who may be facing same problem and hence this blog.
windows azure product team helped me find the cause of the problem and gave me a workaround which fixed the problem. i’m also told that this issue will be fixed in the coming versions of sdk but till the time the new sdk comes, the workaround recommended by the team can be used to address this problem.
from what i have been told, this is related to an issue with windows azure sdk 1.8 and it happens because iis express is trying to bind same ip address to multiple instances . here’re the entries from applicationhost.config file for 2 instances in which i was trying to run my application which let the product team to that conclusion:
<site name="deployment18(110).windowsazureservice3.windowsazureservice3webrole_in_0_web" id="1273337584"> <application path="/" applicationpool="b31dc554-ad4b-4a18-8a62-098b5079f26d" enabledprotocols="http"> <virtualdirectory path="/" physicalpath="d:\projects\windowsazureservice3\windowsazureservice3webrole\" /> </application> <bindings> <binding protocol="http" bindinginformation="*:82:" /> </bindings> <logfile logextfileflags="date, time, clientip, username, sitename, computername, serverip, method, uristem, uriquery, httpstatus, win32status, bytessent, bytesrecv, timetaken, serverport, useragent, cookie, referer, protocolversion, host, httpsubstatus" logformat="w3c" directory="c:\users\gaurav.mantri\appdata\local\dftmp\resources\40fae03f-8519-4c66-a36b-da8e2de73e9d\directory\diagnosticstore\logfiles\web" period="hourly" /> <tracefailedrequestslogging enabled="true" directory="c:\users\gaurav.mantri\appdata\local\dftmp\resources\40fae03f-8519-4c66-a36b-da8e2de73e9d\directory\diagnosticstore\failedreqlogfiles\web" maxlogfiles="1000" /> </site>
<site name="deployment18(110).windowsazureservice3.windowsazureservice3webrole_in_1_web" id="1273337584"> <application path="/" applicationpool="92214b82-0516-4502-8e38-4d94c3cdf949" enabledprotocols="http"> <virtualdirectory path="/" physicalpath="d:\projects\windowsazureservice3\windowsazureservice3webrole\" /> </application> <bindings> <binding protocol="http" bindinginformation="*:82:" /> </bindings> <logfile logextfileflags="date, time, clientip, username, sitename, computername, serverip, method, uristem, uriquery, httpstatus, win32status, bytessent, bytesrecv, timetaken, serverport, useragent, cookie, referer, protocolversion, host, httpsubstatus" logformat="w3c" directory="c:\users\gaurav.mantri\appdata\local\dftmp\resources\3c7c31cb-a2fb-4809-aadb-9238acb2f092\directory\diagnosticstore\logfiles\web" period="hourly" /> <tracefailedrequestslogging enabled="true" directory="c:\users\gaurav.mantri\appdata\local\dftmp\resources\3c7c31cb-a2fb-4809-aadb-9238acb2f092\directory\diagnosticstore\failedreqlogfiles\web" maxlogfiles="1000" /> </site>
as you can see from above in the “binding” section, both instances were trying to bind to port 82 and hence the error.
there were two workarounds recommended by the windows azure sdk team:
install visual studio 2010 sp1
if you’re using visual studio 2010, it is recommended that you install sp1 for that. seemingly that takes care of this problem. since i don’t have vs 2010 on my machine, i did not try it as it was not applicable to me.
add an environment variable
other workaround recommended was to add an environment variable called “ _csrun_disable_workarounds ” and set the value of this variable to “ 1 ”. to set an environment varaible, search for “ control panel ” and then go to “ system ” –> “ advanced system settings ” –> “ advanced ” tab –> “ environment variables… ” button –> “ new… ” button.
i’ve also added a screenshot for your convenience as well.
after you do that you would need to restart iis express and compute/storage emulator .
i tried this approach and it worked for me.
hope this helps!
Published at DZone with permission of Gaurav Mantri, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.