项目中的依赖项OpenIddict不支持框架DNXCore,Version = v5.0

时间:2016-03-12 18:19:52

标签: asp.net asp.net-core aspnet-contrib openiddict

我做了所有被告知[on OpenIddict getting started tutorial]的事情:

  • 我跑了dnvm升级
  • 我已将所有给定的来源添加到Nuget.Config
  • 添加" OpenIddict":" 1.0.0 - *" to project.json dependencies

这就是Visual Studio在将鼠标悬停在红色下划线时所说的内容" OpenIddict" project.json中的依赖:

  

项目[...]中的依赖OpenIddict 1.0.0-alpha2-0161不支持框架DNXCore,Version = v5.0

清理项目和恢复nuget包并没有帮助。 我该怎么做才能让它发挥作用?

编辑:

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" ]
  }
}

1 个答案:

答案 0 :(得分:2)

遗憾的是,您无法在ASP.NET 5 / Core RC1应用程序中使用OpenIddict:必须使用ASP.NET Core RC2 ,如getting started page中所述。

如果您想迁移到RC2,可以查看Mvc.Server示例: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"
    ]
  }
}
相关问题