Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The dependency microsoft.aspnetcore.mvc 1.0.0 does not support framework .NETCoreApp, Version=v1.0

Tags:

asp.net-core

Trying to create an ASP.NET Core project given that it has just reached RTM. I created a new project using the Visual Studio 2015 Update 3 template called 'ASP.NET Core Web Application (.NET Core)'. I then went to the Nuget Package Manager and updated all the package.json packages to 1.0.0. Visual Studio fails to restore the package with the error in the title of this post.

Here is the project.json after updating Nuget Packages:

{ 
  "dependencies": {
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.NETCore.App": "1.0.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview-final",
      "imports": "portable-net45+win8+dnxcore50"
    }
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "gcServer": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

The output from the Nuget Package Manager:

Package Microsoft.AspNetCore.Mvc 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNetCore.Mvc 1.0.0 supports: - net451 (.NETFramework,Version=v4.5.1) - netstandard1.6 (.NETStandard,Version=v1.6)

like image 890
Blake Mumford Avatar asked Jun 29 '16 00:06

Blake Mumford


2 Answers

Did you remember to install: .NET Core Tools for Visual Studio? You can get that here.

Take a look at Scott Hanselman's Blog.

like image 156
Starlight Coder Avatar answered Nov 03 '22 00:11

Starlight Coder


NetCoreApp needs to be of type 'platform'.

like image 25
Shawn Wildermuth Avatar answered Nov 03 '22 01:11

Shawn Wildermuth