2015-09-08 48 views
4

我正在使用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" 
    ] 
} 
+0

你能分享一下'project.json'文件嗎? –

+0

@VictorHurdugaci,當然是 – MichaelS

+0

你有沒有更新工具到beta7呢? Pre-beta7工具不能用於beta-7項目... – Pawel

回答

6

我有完全相同的問題。我嘗試重新安裝Web Tools以及修復VS(Professional)。

File-> New Project拋出同樣的錯誤。

我的解決方案是安裝德語語言包(我正在使用德語Visual Studio)。問題是,當我第一次安裝beta7時,語言包中止了一個我不記得的錯誤,但是當我重試時,它工作正常。

Regards Daniel

+0

謝謝。似乎beta web工具在國際化方面存在問題 – daniel

+1

謝謝,那正是問題所在 – MichaelS