最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

database - SAP HANA drivers Sap.Data.Hana.Net.v8.0 failed to load when publishing program in single file mode on a C# .NET 8 pro

programmeradmin2浏览0评论

I use the latest drivers Sap.Data.Hana.Net.v8.0.dll I found as an external assembly to connect to SAP HANA database in a C# .NET 8 CLI program.

I have the following error when running my program if I publish my project with the single file publish option activated:

Source : System.Private.CoreLib
Message : Value cannot be null. (Parameter 'path1')
Failed Load

If I publish the project without the single file option, the program is working fine but I have many DLLs embedded in the published directory and I would like to avoid that.

I use the latest drivers Sap.Data.Hana.Net.v8.0.dll I found as an external assembly to connect to SAP HANA database in a C# .NET 8 CLI program.

I have the following error when running my program if I publish my project with the single file publish option activated:

Source : System.Private.CoreLib
Message : Value cannot be null. (Parameter 'path1')
Failed Load

If I publish the project without the single file option, the program is working fine but I have many DLLs embedded in the published directory and I would like to avoid that.

Share Improve this question edited yesterday marc_s 755k184 gold badges1.4k silver badges1.5k bronze badges asked 2 days ago Romain FerratonRomain Ferraton 711 silver badge6 bronze badges 2
  • learn.microsoft.com/en-us/dotnet/core/deploying/single-file/… – Hans Passant Commented 2 days ago
  • Thanks @HansPassant for your link but when I try to exlude the dll from the singlefile compilation , I receive another error : Message : CodeBase is not supported on assemblies loaded from a single-file bundle. I think the Sap.Data.Hana.Net.v8.0.dll version i use (2.23.26) is not singlefile compatible – Romain Ferraton Commented 16 hours ago
Add a comment  | 

1 Answer 1

Reset to default 1

I achieve to have a single file working using additionnal directives in the csproj file :

<PropertyGroup>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
    <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
</PropertyGroup>

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论