4

I'm using Visual Studio 2015 Community Edition and updated my existing ASP.NET MVC6 application to beta7. Now I'm not able to open the project anymore. Visual Studio crashes with the following Exception:

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()<---

Googling for the error message The specified default content type (Default) is not defined in the project item schema. didn't brought any helpful hint. First I thought it has something to do with the dnvm. So this is my dnvm list result:

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

My global.json looks like this:

{
    "projects": [ "src", "test" ],
    "sdk": {
        "version": "1.0.0-beta7"
    }
}

Removing the sdk part does not change anything.

EDIT: 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"
    ]
}
MichaelS
  • 3,809
  • 2
  • 26
  • 33
  • Can you please share the `project.json` file? – Victor Hurdugaci Sep 08 '15 at 19:50
  • @VictorHurdugaci, yes of course – MichaelS Sep 08 '15 at 19:56
  • Have you update the tools to beta7 as well? Pre-beta7 tools don't work with beta-7 projects... – Pawel Sep 15 '15 at 03:45
  • @Pawel I installed the Microsoft ASP.NET and Web Tools 2015 (Beta7). Did I miss something else? – MichaelS Sep 15 '15 at 16:49
  • @MichaelS could you share a sample project? Here are some things to try: delete .dnx/packages from your users directory and then restore packages, another thing is to specify version numbers in project.json. One question, when you create a project with File->New Project does it work when using ASP.NET 5 Beta7? – Sayed Ibrahim Hashimi Sep 15 '15 at 17:27
  • @SayedIbrahimHashimi I can't create a new project, the same error appears. – MichaelS Sep 15 '15 at 18:10
  • @MichaelS I'm really sorry to hear that you're running into this. I'm not sure what's the best way for me to help you. Can you email me? sayedha@microsoft.com – Sayed Ibrahim Hashimi Sep 16 '15 at 02:38
  • Hi, I have exact the same problem. Beta 6 projects: incompatible projects New project: Exception and no project Is there any resolution? – Tim Sep 16 '15 at 17:17
  • 2
    One additional thing to try. Close VS, then delete the folder at %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache and restart – Sayed Ibrahim Hashimi Sep 16 '15 at 18:23
  • @SayedIbrahimHashimi, I tried that, but without success. Installing the language pack as suggested by Daniel solved my problem. – MichaelS Sep 17 '15 at 17:31
  • @SayedIbrahimHashimi's comment about deleting the ComponentModelCache folder fixed the incompatible project type error that I was getting. Thank you! – Paul Speranza Oct 16 '15 at 13:37

1 Answers1

6

I had exactly the same problem. I tried reinstalling the Web Tools as well as repairing VS (Professional).

File->New Project threw the same error.

My solution was to install the german language pack (I am using german Visual Studio). The problem was, that when I first installed beta7 the language pack aborted with an error that I cannot remember, but when I retried, it worked.

Regards Daniel

Daniel
  • 76
  • 1