aokelly
aokelly

Reputation: 359

Problem consuming .NET 4.6.1 NuGet packages in NET Standard project ( missing dlls in bin )

I have a NET Standard 2.0 project that I made and I want to consume some .NET 4.6.1 NuGet packages. I'm getting all sorts of warnings from the packages references along the lines of "Package 'DealerVision 2.1.31' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project."

I know that this doesn't necessarily mean that they're not compatible, but the problem I'm having is that I need the dlls that are in these nuget packages to be moved to the bin folder of the NET Standard project, and that is not happening right now.

If I were using a NET 4.6.1 version of the project they all appear in the bin folder, but when it's a NET Standard 2.0 the dlls are not added to the bin folder.

What should I do?

Upvotes: 0

Views: 674

Answers (1)

Anders Abel
Anders Abel

Reputation: 69300

I'm sorry, but you can't do that.

A .NET Standard 2.0 Project can be run on either .NET Core or .NET Framework or any other .NET Standard implementations.

The idea with a package targeting .NET Standard is that you say that "this thing will work on any .NET Standard compatible platform." If you let that package depend on .Net 4.6.1 packages, you have locked it in to only run on .NET Framework.

So either you have to only depend on other .Net Standard packages. Or you have to change the target of your package.

Upvotes: 1

Related Questions