I am trying to build the nuget package of the GDCM project. This project is written in C++ and offer a C# binding using SWIG.
Here is my current attempt:
This is based mostly on:
And references from:
- https://learn.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks
- https://learn.microsoft.com/en-us/dotnet/core/rid-catalog
When I install this nuget package in a Visual Studio 2019 test project (.NET Framework 4, on Windows 8.1) here is the error message that I get:
--EntryPointNotFoundException
at gdcm.gdcmPINVOKE.new_ImageReader()
at gdcm.ImageReader..ctor()
at My.ReadSequenceVolume(Boolean doRead) in C:\Users\malat\test\ImageVolumeReader.cs:line 17
Result Message:
My.DicomBase.ImageReaderFileException : ImageReaderFileException exception : "Unable to find an entry point named 'CSharp_gdcm_new_ImageReader' in DLL 'gdcmsharpglue'." (type=System.EntryPointNotFoundException) while reading "RGB.dcm"
----> System.EntryPointNotFoundException : Unable to find an entry point named 'CSharp_gdcm_new_ImageReader' in DLL 'gdcmsharpglue'.
Is there an issue in the hierarchy I build for this native nuget package ?
Update: Per suggestion, I tried adding Microsoft.NETCore.Platforms
:
<dependencies>
<dependency id="Microsoft.NETCore.Platforms" version="1.0.0" />
</dependencies>
Which gave me:
But now my test project reports:
Severity Code Description Project File Line Suppression State
Error Could not install package 'Microsoft.NETCore.Platforms 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.