2

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:

enter image description here

This is based mostly on:

And references from:

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:

enter image description here

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.                
malat
  • 12,152
  • 13
  • 89
  • 158
  • the runtimes folder in the package might only work with SDK style projects and only when run with the dotnet cli (which Visual Studio does for SDK style projects). You didn't say what kind of test project you created. Also, the runtimes folder might only work if you also include the `Microsoft.NETCore.Platforms` package (won't be needed by the time .NET Core SDK 3.0 becomes GA, work currently in progress, hopefully next 3.0-preview). – zivkan Jun 07 '19 at 16:37
  • Also, the error message sounds like the method in the native assembly can't be found, rather than the dll not being found. Are you sure that method name exists? – zivkan Jun 07 '19 at 16:38

0 Answers0