2

我正在尝试构建GDCM项目的 nuget 包。该项目是用 C++ 编写的,并使用SWIG提供 C# 绑定。

这是我目前的尝试:

在此处输入图像描述

这主要基于:

以及来自:

当我在 Visual Studio 2019 测试项目(Windows 8.1 上的 .NET Framework 4)中安装此 nuget 包时,我收到以下错误消息:

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

这给了我:

在此处输入图像描述

但现在我的测试项目报告:

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

0 回答 0