升级到 ASP.NET MVC 6 beta 7 后打开现有项目时出现异常
Exception on opening existing project after ugrading to ASP.NET MVC6 beta7
我正在使用 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()<---
谷歌搜索错误消息指定的默认内容类型(默认)未在项目项架构中定义。没有带来任何有用的提示。首先我认为它与 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
我的 global.json 看起来像这样:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7"
}
}
删除 sdk 部分不会改变任何内容。
编辑:这是我的 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 工具以及修复 VS(专业版)。
文件->新建项目抛出同样的错误。
我的解决方案是安装德语语言包(我使用的是德语 Visual Studio)。问题是,当我第一次安装 beta7 时,语言包因我不记得的错误而中止,但当我重试时,它起作用了。
问候丹尼尔
我正在使用 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()<---
谷歌搜索错误消息指定的默认内容类型(默认)未在项目项架构中定义。没有带来任何有用的提示。首先我认为它与 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
我的 global.json 看起来像这样:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7"
}
}
删除 sdk 部分不会改变任何内容。
编辑:这是我的 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 工具以及修复 VS(专业版)。
文件->新建项目抛出同样的错误。
我的解决方案是安装德语语言包(我使用的是德语 Visual Studio)。问题是,当我第一次安装 beta7 时,语言包因我不记得的错误而中止,但当我重试时,它起作用了。
问候丹尼尔