admin管理员组文章数量:1332372
I'm working with GDAL to get the ElevationMap of GeoTIFF files in an .NET6 / Visual Studio 2022 environment.
In the Debug or Release everything works fine (there is a ./gdal subfolder in the bin-folder).
When I publish the application with dotnet publish, the ./gdal subfolder doesn't exist in the publish-folder. So the native gdal DLL's can't be found.
How do I get the gdal-subfolder to be copied to the publish-folder as well?
I use this command:
dotnet publish -c Release -r win-x64 --self-contained true --output C:\publish MySolution.sln
I tried to reference the GDAL.Native package in the startup project too, but it didn't help.
Update: I finally solved the problem by this code in the project file:
<Target Name="PublishGDAL" AfterTargets="Publish">
<Exec Command="move $(OutputPath)\gdal $(PublishDir)" />
</Target>
本文标签: visual studio 2022GDAL Native DLL39s not copied with dotnet publishStack Overflow
版权声明:本文标题:visual studio 2022 - GDAL Native DLL's not copied with dotnet publish - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742309468a2450575.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论