views:

93

answers:

1

This is driving us crazy... In VS2010, MVC2 projects, not all projects.... both on a project that was upgraded from 2008/mvc1 and on a brand new project created within 2010/MVC2, we have the following behavior:

1) develop as normal..

2) hit F5 or CTRL-F5 to open up a browser

3) works great!

4) add a CSS file (or JS file or any file, or remove any file) in the project

5) immediately the dialog pops up "WebDev.WebServer20.exe has stopped working"

You have to close the program, and "F5" again - and all is right with the world...

Say we then modify an existing css file. No problem. But adding or removing one, immediate crash.

It seems like the development webserver is "locked on" to the project file and when it detects a change, it dies.

The Event Viewer is pretty unhelpful. The following is logged:

Faulting application WebDev.WebServer20.exe, version 10.0.30319.1, time stamp 0x4ba204ca, faulting module KERNEL32.dll, version 6.0.6001.18215, time stamp 0x49953395, exception code 0xe053534f, fault offset 0x000442eb, process id 0x%9, application start time 0x%10.

This is happening on all of our developer workstations, which include some with Windows Sever 2008, some with Windows XP, and some with Windows 7. All are running VS2010 Premium with ReSharper.

Also, the same thing happens on projects which target the 4.0 framework, only the error message referrs to WebDev.WebServer40.exe instead.

Google has revealed nothing. We've already tried "setting a static port" instead of a dynamic port - no help.

Please help if you can.

A: 

So, as it turns out, the problem was due to a certain use of MVCTurbine and StructureMap, but it seems likely that the problem would also occur with other IOC Containers, not just StructureMap.

The author of MVCTurbine has expressed that the fix will be in version 2.2 of that product.

In the meantime, one extra line of code in your Global.asax will solve this problem:

//VNEXT: after Turbine 2.2 we wont need this line anymore...
protected override void ShutdownContext() { CurrentContext = null; ServiceLocator = null; }

This article shows the particular use case we were addressing. The "normal plain vanilla" use of MVCTurbine and StructureMap would not have this problem.

Obviously, great thanks to Javier for being so responsive to help requests!

Travis Laborde