如何构建本机nuget程序包

时间:2019-06-07 11:59:28

标签: c# nuget swig gdcm

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

这是我目前的尝试:

enter image description here

这主要是基于:

引用来自:

当我在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>

哪个给了我

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.                

0 个答案:

没有答案