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
1 Answer
Reset to default 1I achieve to have a single file working using additionnal directives in the csproj file :
<PropertyGroup>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
</PropertyGroup>