简体   繁体   中英

NU1107 Version conflict detected in Unit Test project

I have created a xUnit Test project and I have added a reference to a Class Library. Both projects are .NET Core 2.1. I keep seeing the following error:

Severity    Code    Description Project File    Line    Suppression State
Error   NU1107  Version conflict detected for x. Install/reference x directly to project y to resolve this issue. 

x is the package that is missing and y is my unit test project. So far I have had to install (to the unit test project):

Microsoft.EntityFrameworkCore.Abstractions
Microsoft.EntityFrameworkCore.Analyzers
Microsft.Extensions.Caching.Abstractions

I have installed 75 packages so far in the unit test projects (only a few of these (2) were installed to the class library) and still Visual Studio is asking me to install more - I suspect this is going to go on and on. What is the problem here. Why do I have to install all of these packages in the Unit Test project? So far I have spent about three hours installing these packages. I am obviously missing something.

Probably a nuget package version in Class Library Project is different than the same package in Test Project.

You can right click to the solution and click "Manage NuGet Packages for Solution". Under consolidate tab, it shows if there are different versions for same package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM