我正在使用Visual Studio 2015社區版,並將現有的ASP.NET MVC6應用程序更新爲beta7。現在我無法再開啓該項目了。除了具有以下不同的Visual Studio崩潰:在使用ASP.NET MVC6 beta7之後打開現有項目的例外
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,當然是 – MichaelS
你有沒有更新工具到beta7呢? Pre-beta7工具不能用於beta-7項目... – Pawel