Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core ASP.NET核心Web API和OpenIddict_Asp.net Core_Openiddict - Fatal编程技术网

Asp.net core ASP.NET核心Web API和OpenIddict

Asp.net core ASP.NET核心Web API和OpenIddict,asp.net-core,openiddict,Asp.net Core,Openiddict,我正在尝试将OpenIddict用于我的asp.net核心web api项目。我已经按照编写的说明进行了操作,但是当我尝试构建项目时,我遇到了以下错误 无法解析“.NETCoreApp,版本=v1.1”的“OpenIddict.Mvc(>=1.0.0)” 我通过Visual Studio 2017创建了该项目(我想我默认安装了最新的.NET核心工具)。有什么想法吗 更新: 说明的第一步说明您必须更新包以引用ASP.NET核心RTM包。这意味着什么 还有我的.csproj文件 <Projec

我正在尝试将
OpenIddict
用于我的
asp.net核心web api
项目。我已经按照编写的说明进行了操作,但是当我尝试构建项目时,我遇到了以下错误

无法解析“.NETCoreApp,版本=v1.1”的“OpenIddict.Mvc(>=1.0.0)”

我通过Visual Studio 2017创建了该项目(我想我默认安装了最新的.NET核心工具)。有什么想法吗

更新: 说明的第一步说明您必须更新包以引用ASP.NET核心RTM包。这意味着什么

还有我的.csproj文件

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
    <PackageReference Include="AspNet.Security.OAuth.Validation" Version="$(AspNetContribOpenIdExtensionsVersion)" />
    <PackageReference Include="OpenIddict" Version="$(OpenIddictVersion)" />
    <PackageReference Include="OpenIddict.EntityFrameworkCore" Version="$(OpenIddictVersion)" />
    <PackageReference Include="OpenIddict.Mvc" Version="$(OpenIddictVersion)" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\iBoard.Repositories\iBoard.Repositories.csproj" />
  </ItemGroup>

</Project>

netcoreapp1.1

我还尝试了
Version=“1.0.0-*”

在.csproj中添加缺少的
OpenIddictVersion
/
aspnetcontribopenidextensionversion
属性,它应该可以工作:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
    <AspNetContribOpenIdExtensionsVersion>1.0.0-*</AspNetContribOpenIdExtensionsVersion>
    <OpenIddictVersion>1.0.0-*</OpenIddictVersion>
  </PropertyGroup>

</Project>

netcoreapp1.1
1.0.0-*
1.0.0-*
或者,您也可以直接硬编码正确的版本:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <ItemGroup>
    <PackageReference Include="AspNet.Security.OAuth.Validation" Version="1.0.0-*" />
    <PackageReference Include="OpenIddict" Version="1.0.0-*" />
    <PackageReference Include="OpenIddict.EntityFrameworkCore" Version="1.0.0-*" />
    <PackageReference Include="OpenIddict.Mvc" Version="1.0.0-*" />
  </ItemGroup>

</Project>


您确定已将MyGet提要添加到包源中吗,如自述文件所示?@Pinpoint yes..我已在应用程序的根文件夹中创建了NuGet.config文件,并添加了所需的引用。您是否尝试重新启动VS以确保正确考虑新的提要?是,但仍然否luck@Pinpoint问题解决了…这是你的建议的组合。起初,我尝试使用Version=“1.0.0.-*”,但之前没有重新启动VS,在重新启动时,我使用了变量,但忘记了导入带有声明的文件。因此,请将您的评论作为答案发布,以便接受它。谢谢