【发布时间】:2015-09-08 19:12:43
【问题描述】:
我正在使用 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"
]
}
【问题讨论】:
-
你能分享
project.json文件吗? -
@VictorHurdugaci,当然是的
-
您是否也将工具更新到了 beta7? Beta7 之前的工具不适用于 beta-7 项目...
-
@Pawel 我安装了 Microsoft ASP.NET 和 Web Tools 2015 (Beta7)。我错过了什么吗?
-
还有一件事要尝试。关闭VS,然后删除%localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache文件夹并重启
标签: c# visual-studio-2015 asp.net-core asp.net-core-mvc dnvm