Search code examples
asp.netasp.net-coreaspnet-contribopeniddict

The dependency OpenIddict in project does not support framework DNXCore, Version=v5.0


I did everything that was told [on OpenIddict getting started tutorial]:

  • I ran dnvm upgrade
  • I've added all given sources to Nuget.Config
  • Added "OpenIddict": "1.0.0-*" to project.json dependencies

This is what Visual Studio tells when I hover my mouse over underlined in red "OpenIddict" dependence in project.json:

The dependency OpenIddict 1.0.0-alpha2-0161 in project [...] does not support framework DNXCore, Version=v5.0

Cleaning project and restoring nuget packages doesn't help. What should I do to make it work?

EDIT:

project.json:

{
  "userSecretsId": "[...]",
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "EntityFramework.Commands": "7.0.0-rc1-final",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
    "Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
    "Microsoft.AspNet.Authentication.JwtBearer": "1.0.0-rc1-final",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
    "Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final",
    "Microsoft.AspNet.Identity": "3.0.0-rc1-final",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
    "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
    "Microsoft.Net.Http.Server": "1.0.0-rc1-final",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
    "System.IdentityModel.Tokens": "5.0.0-rc1-211161024",
    "OpenIddict": "1.0.0-*"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel",
    "ef": "EntityFramework.Commands"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ],
  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
  }
}

Solution

  • Sadly, you can't use OpenIddict in an ASP.NET 5/Core RC1 application: you must use ASP.NET Core RC2, as mentioned in the getting started page.

    If you want to migrate to RC2, you can take a look at the Mvc.Server sample: https://github.com/openiddict/openiddict-core/tree/dev/samples/Mvc.Server.

    {
      "buildOptions": {
        "emitEntryPoint": true,
        "warningsAsErrors": true,
        "preserveCompilationContext": true,
    
        "embed": {
          "include": [ "Certificate.pfx" ]
        },
    
        "copyToOutput": {
          "include": [
            "wwwroot",
            "Views",
            "config.json",
            "web.config"
          ]
        }
      },
    
      "dependencies": {
        "AspNet.Security.OAuth.GitHub": "1.0.0-alpha4-final",
        "AspNet.Security.OAuth.Introspection": "1.0.0-alpha1-final",
        "AspNet.Security.OAuth.Validation": "1.0.0-alpha1-final",
        "Microsoft.AspNetCore.Authentication.Google": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.Authentication.Twitter": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
        "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc2-final",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
        "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
        "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
        "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
        "OpenIddict": { "target": "project" }
      },
    
      "frameworks": {
        "net451": {
          "dependencies": {
            "Microsoft.NETCore.Platforms": "1.0.1-rc2-24027"
          }
        },
    
        "netcoreapp1.0": {
          "dependencies": {
            "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-3002702" }
          },
    
          "imports": [
            "dnxcore50",
            "portable-net451+win8"
          ]
        }
      },
    
      "tools": {
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
          "version": "1.0.0-preview1-final",
          "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
        }
      },
    
      "scripts": {
        "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
      },
    
      "publishOptions": {
        "include": [
          "wwwroot",
          "Views",
          "config.json",
          "web.config"
        ]
      }
    }