.net - MVC3项目升级到VS2012后出现AccessViolationException

标签 .net asp.net-mvc asp.net-mvc-3 visual-studio visual-studio-2012

我使用 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/

相关文章:

c# - 如何使用 Moq 模拟 StackExchange.Redis ConnectionMultiplexer 类?

.net - 嵌入式脚本环境的优点/缺点?

c# - LINQ to SQL 问题

asp.net-mvc - asp.net MVC 显示模板和编辑器模板命名约定

javascript - 如何将部分 View 中生成的 HTML 插入到 javascript 代码中?

c# - 自定义配置文件提供程序 : The settings property '' was not found - MVC3

asp.net - 如何删除www. ASP.NET MVC 中的前缀

.net - 如何查找具有特定范围选项的所有变量?

sql-server - 如何使用 GUID 从 SQL Server 表引用 Azure 表数据

asp.net - 如何在 Asp.NET MVC 中使用 RedirectToAction() 传递多个对象?