0

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.

Dani Avni
  • 423
  • 5
  • 14

2 Answers2

0

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

Chilkat Software
  • 1,405
  • 1
  • 9
  • 8
  • Also, to understand .NET Standard, ask ChatGPT "Explain .NET Standard 2.0 with respect to .NET Core and .NET Framework" – Chilkat Software Jun 03 '23 at 23:57
  • Maybe I didnt explain myself correctly so let me try to clarify: I am in the process of moving my framework code to core. but since it cannot be done at once I am currenly moving utilitiy functions that use Chilkat components to a netstandard project so that both the old code and the new one can use it (it will be converted to a core project at the end). The problem is that the framework project referencing the standards project does not get the runtime files copied to it – Dani Avni Jun 04 '23 at 04:49
0

".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.

Chilkat Software
  • 1,405
  • 1
  • 9
  • 8