-2

From studying NuGe, it appears that all versions of Auto-Fixture have a dependency on .NET Framework as well as .NET Standard.

When testing a .NET Core project, requiring a .NET Framework dependency for the test library would not necessarily require that the .NET Core application also have a dependency on .NET Framework.

But the situation overall implies that there does not exist a version of Auto-Fixture that depends ONLY on .NET Standard.

Is that the case?

Stato Machino
  • 1,120
  • 3
  • 13
  • 22
  • The latest version of [AutoFixture](https://www.nuget.org/packages/AutoFixture) supports .NETStandard 1.5 and 2.0 – DavidG Apr 13 '21 at 15:23

1 Answers1

0

The way .NET projects reference NuGet packages is different than what you imply in the question.

NuGet packages are nothing more than ZIP archives that typically contain some files, which will be referenced by the project upon install, and some metadata.

Typically NuGet packages that target multiple .NET (.NET Framework, .NET Standard, etc.) will have separate directories for binaries built with each supported target framework.

By default when a .NET project installs a NuGet package, it will look for binaries targeting the latest version of .NET, compatible with the target version of the project.

At the moment of writing, AutoFixture supports .NET Framework 4.5, .NET Standard 1.5 and .NET Standard 2.0.

When you'll build your .NET Core test project, only the assemblies built with the latest supported version of .NET Standard, will be copied from the AutoFixture package, into your output directory. It will not copy the binaries built with .NET Framework. Also this most definitely does not add a .NET Framework dependency to your .NET Core project.

To see which version will be picked you can visit this page and look for your target framework.

Andrei Ivascu
  • 1,172
  • 8
  • 17