Runtime libraries are not installed or copied

135 Views Asked by At

I have a netstandard 2.0 project that I am trying to add into it a reference to nuget ChilkatDnStandard. The ChilkatDnStandard library depends on ChilkatNativeLib which contains all the native libraries for various platforms.

This library mentioned above is then referenced in the same solution (project reference) by two projects: One is dotnet core 7, one is dotnet framework 4.8. When compiling these projects, the netstandrard project is copied, the ChilkatDnStandard library is copied but the runtimes folder that comes out of the ChilkatNativeLib is not copied over resulting in errors when trying to run these two projects.

If I add a reference to ChilkatNativeLib in the netstandard library then the runtimes are copied to the core 7 project but not to the net 4.8 project.

My netstandard project already contains <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> (without it I saw that assemblies referenced by the netstandard library would not be copied to the core/framework projects)

Was I supposed to add to the netstandard project the ChilkatNativeLib library to begin with? why is the runtimes folder that ChilkatNativeLib creates is not being copied to the core/framework projects? I think I could add the ChilkatNativeLib reference to the core/framework projects so the runtimes get there but I am not sure that is the way it is supposed to work.

2

There are 2 best solutions below

2
Chilkat Software On

It's not correct to reference the ChilkatDnStandard library from a .NET Framework 4.8 project. For the .NET Framework 4.8 project, you should reference one of the following NuGet packages:

https://www.nuget.org/packages/chilkat-x64

or

https://www.nuget.org/packages/chilkat-win32

0
Chilkat Software On

".NET Standard 2.0 is a version of the .NET Standard specification, which is a set of APIs that define a common base for .NET platforms to implement." -- ChatGPT.

In other words, let's say .NET Standard 2.0 is comprised of A, B, E, G. .NET Core 7 is comprised of A, B, C, E, G, Z .NET Framework 4.8 is comprised of A, B, D, G, Y

When you create project conforming to .NET Standard 2.0, you're saying: "I'm only using things in the .NET Standard 2.0 API" -- for example, A, B, E, and G.

Thus your source code can be used in either a .NET Core 7 or .NET Framework 4.8 project.

There is no such thing as a ".NET Standard 2.0" project. It can be a .NET Core 7 project that restrains itself to using only things in the .NET Standard 2.0 API, or perhaps it is a .NET Framework 4.8 project that restrains itself to using only things in the .NET Standard 2.0 API.