C# 升级到ASP.NET MVC6 beta7后打开现有项目的例外情况
我正在使用Visual Studio 2015社区版,并将现有的ASP.NET MVC6应用程序更新为beta7。现在我无法再打开项目了。Visual Studio崩溃,出现以下异常:C# 升级到ASP.NET MVC6 beta7后打开现有项目的例外情况,c#,visual-studio-2015,asp.net-core,asp.net-core-mvc,dnvm,C#,Visual Studio 2015,Asp.net Core,Asp.net Core Mvc,Dnvm,我正在使用Visual Studio 2015社区版,并将现有的ASP.NET MVC6应用程序更新为beta7。现在我无法再打开项目了。Visual Studio崩溃,出现以下异常: 08.09.2015 20:23:12 Crippling System.AggregateException: One or more errors occurred. ---> Microsoft.Assumes+InternalErrorException: The specified default
08.09.2015 20:23:12
Crippling
System.AggregateException: One or more errors occurred. ---> Microsoft.Assumes+InternalErrorException: The specified default content type (Default) is not defined in the project item schema.
at Microsoft.Assumes.Fail(String message, Boolean showAssert)
at Microsoft.VisualStudio.ProjectSystem.Items.ProjectItemSchemaManagerBase.<ComputeCacheDataAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.Items.ProjectItemSchemaManager.<CreateSchemaFromSnapshotDataAsync>d__21.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.Assumes+InternalErrorException: The specified default content type (Default) is not defined in the project item schema.
at Microsoft.Assumes.Fail(String message, Boolean showAssert)
at Microsoft.VisualStudio.ProjectSystem.Items.ProjectItemSchemaManagerBase.<ComputeCacheDataAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.Items.ProjectItemSchemaManager.<CreateSchemaFromSnapshotDataAsync>d__21.MoveNext()<---
My global.json如下所示:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7"
}
}
删除sdk部件不会改变任何事情
编辑:这是我的项目。json
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.Framework.Configuration.Json": "1.0.0-*",
"Microsoft.AspNet.Authentication": "1.0.0-*"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"compilationOptions": {
"allowUnsafe": true
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
]
}
我也有同样的问题。我尝试重新安装网络工具以及修复VS(专业版) 文件->新建项目引发了相同的错误 我的解决方案是安装德语语言包(我使用的是德语Visual Studio)。问题是,当我第一次安装beta7时,语言包由于一个我不记得的错误而中止,但当我重试时,它成功了
尊敬Daniel你能分享
project.json
文件吗?@VictorHurdugaci,当然可以。你也把工具更新到beta7了吗?beta7之前的工具不适用于beta-7项目…@Pawel I安装了Microsoft ASP.NET和Web tools 2015(beta7)。我错过了什么吗?还有一件事要尝试。关闭VS,然后删除位于%localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache的文件夹并重新启动谢谢。似乎beta版web工具在国际化方面存在问题谢谢,这正是问题所在
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.Framework.Configuration.Json": "1.0.0-*",
"Microsoft.AspNet.Authentication": "1.0.0-*"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"compilationOptions": {
"allowUnsafe": true
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
]
}