1

I have a netstandard 2.0 class library which depends on a number of nuget packages.

Next, I have a .NET 4.7 web API project referencing this project.

I now get a bunch of dependency errors, because the web API project can't find the assemblies referenced in the class library.

Before .netstandard I would have just set CopyLocal=true on the dll under references, but I can't find anywhere to do the same in netstandard class library

4
  • 1
    Package the library, specify dependencies in the package? Or do you need it to remain a project reference?
    – CodeCaster
    Nov 29, 2017 at 13:36
  • 1
    I had this question too, that is why always i use .net Framework class library
    – Ferus7
    Nov 29, 2017 at 13:54
  • Like the other comment indicated, you have to give up packages.config and switch to package reference in Visual Studio 2017. Then the dependencies would automatically work.
    – Lex Li
    Nov 29, 2017 at 15:54
  • @CodeCaster I did need it to remain a project reference, as I needed to update the class lib on every build in the project that referenced it, and I didn't know how to automate packaging and updating the nuget package on build. I chose to revert to .net Framework class lib - but I still had issues, and it seems it was a specific issue with system.ui.compression.zipfile
    – Dynde
    Dec 3, 2017 at 19:34

0

Your Answer

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

Browse other questions tagged or ask your own question.