I need to use the NuGet package OPCFoundation.NetStandard.Opc.Ua in a .NET Framework 4.7.x class library.
So far my class library was .NET Framework 4.7.0. It worked OK, although the OPCFoundateion.NetStandard.Opc.Ua package (.NET Standard 2.0) generated a HUGE bunch of shim system DLLs in the bin folder. Not good at all, but it worked.
Because I found all those dozens of shim dll's very annoying I made some research. According to various articles I learned that all those DLLs should go away once I upgrade my class library to version 4.7.2.
Well so I did, but things only got worse.
If you try this:
- Create a brand new solution (VS2017, fully updated)
- Create a blank 4.7.2 class library
- Import the OPCFoundation.NetStandard.Opc.Ua package into the class library
the following happens:
Still 83 system.* (and other) shim packages are being downoaded, installed and stored in the Packages folder
25 warnings pop up, saying: "The referenced component 'System.xxxx.xxxx' could not be found"
If I ignore those warnings and try to use the package nevertheless, I get runtime exceptions saying that various DLLs are missing.
What is going on? Why doesn't it work with 4.7.2 while it works with 4.7.0?
I urge you to try it out for yourself, it is very, very easy to reproduce.
I use packages.config for NuGet handling, mainly because I cannot get our TeamCity build server build the project if I use packageReferences.