Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Test project build fails on multi targeted project with different version of the same package
Axima
#1 Posted : Wednesday, October 23, 2019 10:29:02 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/13/2017(UTC)
Posts: 7
Location: Australia

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
I have a class library that multi targets .NET Standard 2.0, .NET Standard 2.1, and .NET Framework 4.7.2.
I also have a unit test library which multi targets .NET Core 2.2, .NET Core 3.0 and .NET Framework 4.7.2.

The class libary uses Entity Framework packages, specifically:
.NET Standard 2.0: Microsoft.EntityFrameworkCore 2.2.6
.NET Standard 2.1: Microsoft.EntityFrameworkCore 3.0.0
.NET Framework 4.7.2: EntityFramework 6.3.0

These packages are conditionally included in the library .csproj file based on the target framework.

In Visual Studio all projects build fine and I can manually run any test against all 3 frameworks and they work.

NCrunch fails to build the test project for .NET Core 2.2 with the following error:

Quote:
CSC (0, 0): Assembly 'Library' with identity 'Library, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.EntityFrameworkCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.EntityFrameworkCore' with identity 'Microsoft.EntityFrameworkCore, Version=2.2.6.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'


It seems like it is not identifying that .NET Core 2.2 should load the 2.2.6 version of Microsoft.EntityFrameworkCore.
Remco
#2 Posted : Thursday, October 24, 2019 12:35:06 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,830

Thanks: 754 times
Was thanked: 973 time(s) in 927 post(s)
Hi, thanks for sharing this issue.

I appreciate the detail you've provided here. Is there any chance you can build us a small sample solution that reproduces this issue? If we can get this to fail in our environment in exactly the same way it fails in yours, I'm hopeful that we should be able to produce a fix. You can submit code in a ZIP file through the NCrunch contact form.
Axima
#3 Posted : Thursday, October 24, 2019 1:44:34 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/13/2017(UTC)
Posts: 7
Location: Australia

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
Hi Remco,

I created a small sample solution, however each time I try to submit the contact form I get a 404 error.

I have uploaded the solution for a 1 time download from here: https://send.firefox.com...#MXZWVDHCwy9kYcMPD48vSQ

Thanks,
1 user thanked Axima for this useful post.
michaelkroes on 10/25/2019(UTC)
Remco
#4 Posted : Thursday, October 24, 2019 8:10:39 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,830

Thanks: 754 times
Was thanked: 973 time(s) in 927 post(s)
Thanks for the sample project, and sorry about the problem with the contact form.

I can confirm that this sample reproduces the problem consistently on my end. I'll let you know as soon as I'm able to arrange a fix.
1 user thanked Remco for this useful post.
Axima on 10/27/2019(UTC)
michaelkroes
#5 Posted : Friday, October 25, 2019 9:38:02 AM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 164
Location: Netherlands

Thanks: 74 times
Was thanked: 35 time(s) in 33 post(s)
1 user thanked michaelkroes for this useful post.
Axima on 10/27/2019(UTC)
Axima
#6 Posted : Sunday, October 27, 2019 8:29:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/13/2017(UTC)
Posts: 7
Location: Australia

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
That works, thanks.
1 user thanked Axima for this useful post.
michaelkroes on 10/28/2019(UTC)
michaelkroes
#7 Posted : Monday, October 28, 2019 8:35:13 AM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 164
Location: Netherlands

Thanks: 74 times
Was thanked: 35 time(s) in 33 post(s)
That's great, thanks for reporting back!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.043 seconds.