0
votes

I must be missing something but I cannot see it.
I have created a new 'empty' ASP.NET Core 2.0 Project
I added EF Core 2.0 and EF Core 2.0 Identity
I then try to add IdentityServer4 2.0 rc1 and I get a package restore failure with the following error message:

Error occurred while restoring NuGet packages: Sequence contains more than one matching element

There is no code in this project so I am completely confused.

Here is the csproj file:

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="IdentityServer4" Version="2.0.0-rc1-update1" />
    <PackageReference Include="IdentityServer4.AspNetIdentity" Version="2.0.0-rc1" />
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
    <PackageReference Include="NETStandard.Library" Version="2.0.0" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
  </ItemGroup>
</Project>

Here is my call to NuGet.org from the Package Manager Console:

PM> Install-Package IdentityServer4.AspNetIdentity -Version 2.0.0-rc1 -Prerelease GET https://api.nuget.org/v3/registration3-gz-semver2/identityserver4.aspnetidentity/index.json OK https://api.nuget.org/v3/registration3-gz-semver2/identityserver4.aspnetidentity/index.json 484ms Restoring packages for D:\ProtoTypes\IdentityServer4\IdentityServer4\IdentityServer4.csproj... Install-Package : Sequence contains more than one matching element At line:1 char:1 + Install-Package IdentityServer4.AspNetIdentity -Version 2.0.0-rc1 -Pr ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand Time Elapsed: 00:00:03.7728514 PM>

1
Try renaming your project ... maybe to MyIdentityServer4. This might be due to your project having the same name as one of the packages you are installing (IdentityServer4). - Peter
Right, now I feel like a complete ID10T! Thank you @Peter - Jason H

1 Answers

0
votes

Following are some changes that you will migrate your project to asp.net core 2.0. Step 1: Download asp.net core 2.0 gx64x for visual studio 2017 from the following link.https://www.microsoft.com/net/download/core