0
votes

I have a Class Library (.NET Core 2.0) being tested by an MSTest Test Project (.NET Core 2.0). The FluentAssertions site says .NET Core 2.0 is supported (and I stepped down from 2.1). It works locally, but on the build machine I get the following error:

The nuget command failed with exit code(1) and error(Errors in D:\a\1\s\ProjectName.Tests.csproj Package System.Configuration.ConfigurationManager 4.4.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Configuration.ConfigurationManager 4.4.0 supports: - net461 (.NETFramework,Version=v4.6.1) - netstandard2.0 (.NETStandard,Version=v2.0) One or more packages are incompatible with .NETCoreApp,Version=v2.0.)

1
I'm pretty sure .NET Core 2.0 implemented .NETStandard 2.0 so should work...Michal Ciechan
Also that error is pointing at System.Configuration.ConfigurationManagerMichal Ciechan
Personally would try the following (as it looks like there is some incorrect dependency finding): stackoverflow.com/a/39833423/271106Michal Ciechan
Under Dependencies > NuGet > FluentAssertions (5.4.2) there are two items - FluentAssertions.dll and System.Configuration.ConfigurationManager (4.4.0). And in the NuGet UI under Dependencies for FluentAssertions it shows .NETCoreApp, Version=v2.0 it has one - System.Configuration.ConfigurationManager (>=4.4.0)KarlZ
Also have you tried Cleaning out your source on your build server?Michal Ciechan

1 Answers

1
votes

The issue was that the Azure DevOps Build pipeline was using NuGet 4.1.0. I added a task to the pipeline right before the NuGet restore called NuGet Tool Installer and set it to install version 4.4.0. Then everything worked fine. Thanks Dennis Doomen!