Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am working on an ASP.Net core 2.1 web app project. I have 1 project in my solution and 3 other libraries, it's and advanced architecture (data access layer (
DAL
), business layer (
BL
), common layer (
CL
)), so i need to add references to connect some libraries and project. I have added
CL
reference to my project and to libraries
DAL
and
BL
. Now I have to add reference
BL
to my project, but when I add I get this type of error:
Version conflict detected fr Microsoft.EntityFrameworkCore/ Install/reference Microsoft.EntityFrameworkCore 2.2.1 directly to project 'WEB' to resolve this issue
When I am trying to install that version it says
Package restore failed. Rolling back package changes for 'WEB'
I can also mention that when I add reference
BL
to my project, it also includes
DAL
, and
CL
itself, (and
DAL
contains
Microsoft.EntityFrameworkCore
(2.2.1), can't understand what's the problem, any ideas?
Additional Images of the problem in
here
.
project.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CL\CL.csproj" />
</ItemGroup>
</Project>
i have added CL reference as you can see, now i want to add BL reference and get this error
–
–
–
The issue is because you're having local directory path to one of your {projectName}.csproj file
Kindly review your .csproj files by Right clicking project and select Edit {projectName}.scproj
<Reference Include="Microsoft.EntityFrameworkCore">
<HintPath>..\..\..\..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\Microsoft.EntityFrameworkCore\2.1.1\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll</HintPath>
</Reference>
If yes than go to Nuget Package Manager and add your library bu selecting nuget.org as Package Source
after restoring from nuget Package manager csproject file will have following tag Added
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="2.1.1" />
Here {projectName} is the name of C# project.
–
–
–
–
Just want to chip in that i had the same issue but with EntityFrameworkCore 3.0 preview. I solved it by simply downgrading all entityframework 3.0(preview) nuget packages to latest stable (2.2).
Hopefully this helps someone aswell, took me hours...
Option 1 check visual studio error window and identify which package is making the conflict .
make sure both packages have save version code
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.