Closed pdgmdm closed 1 year ago
Hello @pdgmdm, can you send us your source code of your project, please?
Hi, please find attached a sample app which shows the issue. This is a console app, which is linked to a class library, which uses the dicom libs. When publishing the console app as a single file, the Dicom.Native.dll is not copied.
When running the application, this is the output:
Unhandled exception. System.DIlNotFoundException: Dil was not found
After manually coping the dll to the folder, all works fine.
Hi @pdgmdm,
We have tested your sample app as a regular project. There are not problems.
We don't have direct support for self-contained builds. Therefore, you have to take care of the directives for copying the required files.
I guess you will require either <CopyToOutputDirectory>
or <CopyToPublishDirectory>
in your csproj file.
Hello @jaime-olivares , Thanks for this information. I will manually copy the DLL.
However, for future releases, perhaps have a look at https://www.nuget.org/packages/Magick.NET-Q16-AnyCPU , for that package, the DLL is copied correctly also for single file publishes.
Publish to single-file win-x64 does not copy Dicom.Native.dll.
Manually copying the file from bin\Release\net7.0\runtimes\win-x64\native to the publish output folder is required for the application to work correctly.