0

So I have a DLL which is targeting multiple versions (.net 4.5, 4.6.1, netcore 2.0) which is pushed to a Klonkdike Now I want to use this DLL, my project is .net 4.6.1, so I expect to resolve dependencies on this target only. However my packages.config gets all .netcore dependencies. How can I prevent that?

This is the DLL: enter image description here

And this is what is added when fetch this package: enter image description here

I would expect to have only UAParser to be added and no other change since I already have the dependencies. There are 3 folders in the lib folders of the package, so I would expect to only need these specific dependencies...

How can I avoid add all these dependencies?

1 Answer 1

2

UAParser is a pure .NET Standard based library.

.NET Standard versions lower than 2.0 depend on these libraries. However, the new tooling in VS 2017 (make sure you have at least 15.5.0) trims out these packages during build and makes sure the right assemblies are in place (these may also be System.* dll files but are not coming from these packages).

These dlls put in place by tooling are needed to implement the .NET Standard contract on .NET Framework - they forward to .NET Framework implementations.

In the upcoming .NET 4.7.2, the plan is to no longer need any of these DLLs. Until then, they are necessary.

1
  • Thank you. We've moved to 15.5 and resulting build is clean.
    – JScoobyCed
    Commented Sep 29, 2018 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.