我使用 VS2010 开发了一个 MVC3 网站,效果很好。我最近将我的开发环境升级到 VS2012 RTM。我现在无法在调试器中运行网站而不导致开发 Web 服务器崩溃。
WebDev.WebServer40.exe has stopped working
我在 VS2012 中看到两个类似的堆栈跟踪之一:
首先,一个AccessViolationException
:
mscorlib.dll!System.StringComparer.GetHashCode(object obj) + 0xc bytes
mscorlib.dll!System.Collections.Hashtable.GetHash(object key) + 0x10 bytes
mscorlib.dll!System.Collections.Hashtable.InitHash(object key, int hashsize, out uint seed, out uint incr) + 0xf bytes
mscorlib.dll!System.Collections.Hashtable.Remove(object key) + 0x38 bytes
System.dll!System.Collections.Specialized.NameObjectCollectionBase.BaseRemove(string name) + 0x2e bytes
System.Web.dll!System.Web.SessionState.SessionStateItemCollection.Remove(string name) + 0x56 bytes
System.Web.dll!System.Web.SessionState.HttpSessionStateContainer.Remove(string name) + 0xc bytes
System.Web.dll!System.Web.HttpSessionStateWrapper.Remove(string name) + 0xf bytes
Dive7.Site.dll!Dive7.Site.D7WebViewPage<object>.IsAdmin.get() Line 56 + 0x19 bytes C#
其次,一个NullReferenceException
:
mscorlib.dll!System.StringComparer.GetHashCode(object obj) + 0x33 bytes
mscorlib.dll!System.Collections.Hashtable.GetHash(object key) + 0x10 bytes
mscorlib.dll!System.Collections.Hashtable.InitHash(object key, int hashsize, out uint seed, out uint incr) + 0xf bytes
mscorlib.dll!System.Collections.Hashtable.Remove(object key) + 0x38 bytes
System.dll!System.Collections.Specialized.NameObjectCollectionBase.BaseRemove(string name) + 0x2e bytes
System.Web.dll!System.Web.SessionState.SessionStateItemCollection.Remove(string name) + 0x56 bytes
System.Web.dll!System.Web.SessionState.HttpSessionStateContainer.Remove(string name) + 0xc bytes
System.Web.dll!System.Web.HttpSessionStateWrapper.Remove(string name) + 0xf bytes
Dive7.Site.dll!Dive7.Site.D7WebViewPage<object>.IsAdmin.get() Line 56 + 0x19 bytes C#
确切的发生似乎是随机的。
据我所知,我所做的就是安装VS2012,重新启动,然后在新版本的VS中打开我的VS2010解决方案,看到它说升级成功,然后按F5 .
我没主意了。谁能建议可能会发生什么?
最佳答案
请阅读链接 http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815 中的“安装 ASP.NET MVC 4 会破坏 ASP.NET MVC 3 RTM 应用程序”部分。 按照 setps“必需的更新”进行操作,并让我知道此错误是否仍然重现。
关于.net - MVC3项目升级到VS2012后出现AccessViolationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12623517/