Как собрать нативный пакет nuget - PullRequest
2 голосов
/ 07 июня 2019

Я пытаюсь собрать пакет nuget проекта GDCM .Этот проект написан на C ++ и предлагает привязку C # с использованием SWIG .

Вот моя текущая попытка:

enter image description here

Это основано главным образом на:

И ссылках от:

Когда я устанавливаю этот пакет nuget в тестовый проект Visual Studio 2019 (.NET Framework 4, в Windows 8.1), появляется следующее сообщение об ошибке:

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

Есть ли проблема в иерархии, которую я строю для этого собственного пакета nuget?


Обновление: По предложению я попытался добавить Microsoft.NETCore.Platforms:

<dependencies>
    <dependency id="Microsoft.NETCore.Platforms" version="1.0.0" />
</dependencies>

Что дало мне:

enter image description here

Но теперь мой тестовый проект сообщает:

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