10
votes

I have an Asp.Net Core 2 Mvc project. I'm currently trying to separate the data access into a separate project; however, as soon as I add the reference to the data access library, I get a version conflict:

error NU1107: Version conflict detected for Microsoft.AspNetCore.Cryptography.Internal. Reference the package directly from the project to resolve this issue.

error NU1107: MySite.Web -> MySite.DataAccess -> Microsoft.Extensions.Identity.Stores 2.1.1 -> Microsoft.Extensions.Identity.Core 2.1.1 -> Microsoft.AspNetCore.Cryptography.KeyDerivation 2.1.1 -> Microsoft.AspNetCore.Cryptography.Internal (>= 2.1.1)

error NU1107: MySite.Web -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Cryptography.Internal (= 2.1.0).

I've tried instead referencing entity framework identity, but it gives the same error, but with the authentication library instead.

I imagine that the following line is quite an important piece of advice:

Reference the package directly from the project to resolve this issue.

However, I'm unsure what, exactly, this means. My initial thought was that I would reference that package in the MySite.Web project, but speficy the version to be 2.1.0; but when I do that I get continually redirected in a perfect circle back to this same library.

5

5 Answers

12
votes

The reason this happens is that your locally installed Microsoft.AspNetCore.App is of version 2.1.0 and not 2.1.1.

To update that you need to install the latest sdk/runtime.

You can find that on https://dot.net
Just go to Downloads and download the 2.1 SDK (v2.1.301) which includes latest 2.1.1 runtime.

I hope that helps!

1
votes

In my case I had updated one of my projects to use Microsoft.Extensions.Identity v3.0 and this was causing the error - Version conflict detected for Microsoft.AspNetCore.Cryptography.Internal. Not very intuitive error message but rolling the referenced project back to Microsoft.Extensions.Identity 2.2 fixed the issue.

1
votes

You need to install the specific version like: if your .net core is 2.2 then you need to install Entity Framework 2.2 only otherwise you need to update your .net core version but for visual studio 2017 it is only available .net core 2.2 not hire version so you need to install as per your .net core version for visual studio 2017.

Please look the both screenshot for your further reference.

enter image description here

enter image description here

0
votes

Try update sdk

If there is packages doesn't installed or not compatabile with it

Try change the version from .csproj file of your main project

<PropertyGroup>
   <TargetFramework>
netcoreapp2.1
</TargetFramework>
 </PropertyGroup>
-1
votes

Delete the conflicting reference and try again

Click Here