.NET Standard projects are designed to run on multiple different .NET platforms (.NET Core, .NET Framework, Mono etc). When asked to run an ad-hoc test method, TestDriven.Net will attempt to execute it using the same .NET Framework version as Visual Studio.
The .NET Core and .NET Framework have different assembly resolution strategies. .NET Framework expects assemblies to be on the application base, the GAC or resolved using a custom assembly resolve event. .NET Core specifies its dependencies in a .deps.json file.
In order to resolve any referenced assemblies when using the .NET Framework, you will need to copy and dependencies to the application base. This can be done by setting the CopyLocalLockFileAssemblies property to true in your .NET Standard project file. For example:
I'm planning to support this by default in the next release.
What isn't supported
Native dependencies
Because the project doesn't know which runtime is being targeted, CopyLocalLockFileAssemblies doesn't know which native dependencies to copy.
It will work with NuGet packages that copy native dependencies so they are portable across multiple (for example LibGit2Sharp.Portable).
Creating App.config files and bindingRedirects
If there are conflicting assembly versions references between NuGet packages it doesn't know how to create an App.config that consolidates the versions.
.NET Standard projects
.NET Standard projects are designed to run on multiple different .NET platforms (.NET Core, .NET Framework, Mono etc). When asked to run an ad-hoc test method, TestDriven.Net will attempt to execute it using the same .NET Framework version as Visual Studio.
The .NET Core and .NET Framework have different assembly resolution strategies. .NET Framework expects assemblies to be on the application base, the GAC or resolved using a custom assembly resolve event. .NET Core specifies its dependencies in a
.deps.json
file.In order to resolve any referenced assemblies when using the .NET Framework, you will need to copy and dependencies to the application base. This can be done by setting the
CopyLocalLockFileAssemblies
property totrue
in your .NET Standard project file. For example:Hints and tips
I'm planning to support this by default in the next release.
What isn't supported
Because the project doesn't know which runtime is being targeted,
CopyLocalLockFileAssemblies
doesn't know which native dependencies to copy.It will work with NuGet packages that copy native dependencies so they are portable across multiple (for example
LibGit2Sharp.Portable
).App.config
files andbindingRedirects
If there are conflicting assembly versions references between NuGet packages it doesn't know how to create an
App.config
that consolidates the versions.Related
Any questions?
Please ask questions and share any tips you have below.