fo-dicom
全称:Fellow Oak DICOM
是一个处理 DICOM 协议及图像相关的类库,基于 .Net 平台。
问题
通过 nuget 将 fo-dicom 添加到项目,编译后 Dicom.Native.dll 没有自动拷贝到 编译输出目录。
Dicom.Native.dll 跟接收和处理 DICOM 图像有密切的关系
解决办法
以下是 github 上的方法,大致意思是 将项目编译配置 cpu 指令架构指定为 x86 或者 x64.
When installing fo-dicom via NuGet, a build script fo-dicom.targets is inserted into the Visual Studio project. This build script is responsible for fetching the Dicom.Native*.dll associated with the current build architecture to the build output (/bin) folder.
The fetch procedure only works if the build architecture of the project is set to either x86 (fetches Dicom.Native.dll) or x64 (fetches Dicom.Native64.dll), otherwise you will be prompted in the build log to select an appropriate build architecture.
This means that, when installing via NuGet, you will be able to sufficiently build your fo-dicom referencing application or class library even in the Any CPU architecture setting, but you will not be able to access the native codecs since these libraries will not be copied to the build output folder. To sufficiently access the native codecs via your application, please make sure that the project build architecture is set to x86 or x64.
https://github.com/fo-dicom/fo-dicom/wiki/Native-codecs-on-.NET