升级到ASP后打开现有项目的例外.NET MVC6 beta7
本文关键字:项目 NET beta7 MVC6 ASP | 更新日期: 2023-09-27 18:12:00
我正在使用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 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()<---
搜索错误消息指定的默认内容类型(default)未在项目项架构中定义。没有带来任何有用的提示。一开始我以为这和dnvm有关。这是我的dnvm list
结果:
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-beta5 clr x64 win
1.0.0-beta5 clr x86 win
1.0.0-beta5 coreclr x64 win
1.0.0-beta5 coreclr x86 win
1.0.0-beta6 clr x64 win
1.0.0-beta6 clr x86 win
1.0.0-beta7 clr x64 win
* 1.0.0-beta7 clr x86 win default
1.0.0-beta7 coreclr x64 win
1.0.0-beta7 coreclr x86 win
我的全球。Json是这样的:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7"
}
}
删除sdk部分不会改变任何东西。
编辑:this is my project.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"
]
}
我也遇到了同样的问题。我试着重新安装Web Tools以及修复VS (Professional)。
File->New Project抛出了相同的错误。
我的解决方案是安装德语语言包(我使用德语Visual Studio)。问题是,当我第一次安装beta7时,语言包因一个错误而终止,我不记得了,但当我重新尝试时,它工作了。
认为丹尼尔