Skip to content

Commit ee97319

Browse files
committed
try fix native files copy
1 parent ef2149b commit ee97319

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

src/S7CommPlusDriver/OpenSSL/Native.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ private static IntPtr DllImportResolver(string libraryName, Assembly assembly, D
3737
if (libraryName == DLLNAME)
3838
{
3939
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.X86)
40-
return NativeLibrary.Load(Path.Combine("runtimes", "win-x86", "libcrypto-3.dll"), assembly, searchPath);
40+
return NativeLibrary.Load(Path.Combine("runtimes", "win-x86", "native", "libcrypto-3.dll"), assembly, searchPath);
4141
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.X64)
42-
return NativeLibrary.Load(Path.Combine("runtimes", "win-x64", "libcrypto-3-x64.dll"), assembly, searchPath);
42+
return NativeLibrary.Load(Path.Combine("runtimes", "win-x64", "native", "libcrypto-3-x64.dll"), assembly, searchPath);
4343
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
44-
return NativeLibrary.Load(Path.Combine("runtimes", "win-arm64", "libcrypto-3-arm64.dll"), assembly, searchPath);
44+
return NativeLibrary.Load(Path.Combine("runtimes", "win-arm64", "native", "libcrypto-3-arm64.dll"), assembly, searchPath);
4545
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
46-
return NativeLibrary.Load(Path.Combine("runtimes", "osx-arm64", "libcrypto.3.dylib"), assembly, searchPath);
46+
return NativeLibrary.Load(Path.Combine("runtimes", "osx-arm64", "native", "libcrypto.3.dylib"), assembly, searchPath);
4747
return IntPtr.Zero;
4848
}
4949

5050
if(libraryName == SSLDLLNAME)
5151
{
5252
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.X86)
53-
return NativeLibrary.Load(Path.Combine("runtimes", "win-x86", "libssl-3.dll"), assembly, searchPath);
53+
return NativeLibrary.Load(Path.Combine("runtimes", "win-x86", "native", "libssl-3.dll"), assembly, searchPath);
5454
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.X64)
55-
return NativeLibrary.Load(Path.Combine("runtimes", "win-x64", "libssl-3-x64.dll"), assembly, searchPath);
55+
return NativeLibrary.Load(Path.Combine("runtimes", "win-x64", "native", "libssl-3-x64.dll"), assembly, searchPath);
5656
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
57-
return NativeLibrary.Load(Path.Combine("runtimes", "win-arm64", "libssl-3-arm64.dll"), assembly, searchPath);
57+
return NativeLibrary.Load(Path.Combine("runtimes", "win-arm64", "native", "libssl-3-arm64.dll"), assembly, searchPath);
5858
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
59-
return NativeLibrary.Load(Path.Combine("runtimes", "osx-arm64", "libssl.3.dylib"), assembly, searchPath);
59+
return NativeLibrary.Load(Path.Combine("runtimes", "osx-arm64", "native", "libssl.3.dylib"), assembly, searchPath);
6060
return IntPtr.Zero;
6161
}
6262

src/S7CommPlusDriver/S7CommPlusDriver.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<StartupObject />
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
13-
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
1412
<PackageReference Include="zlib.net-mutliplatform" Version="1.0.8" />
1513
</ItemGroup>
1614
<ItemGroup>
@@ -24,9 +22,11 @@
2422
<Content Remove="runtimes\info.txt" />
2523
</ItemGroup>
2624
<ItemGroup>
27-
<Folder Include="runtimes\win-arm64\" />
25+
<None Include="build\net8.0\CopyNativeFiles.targets" Pack="true" PackagePath="build\net8.0\" />
26+
</ItemGroup>
27+
<ItemGroup>
28+
<Folder Include="runtimes\linux-x64\" />
2829
<Folder Include="runtimes\osx-x64\" />
29-
<Folder Include="runtimes\osx-arm64\" />
3030
</ItemGroup>
3131
<PropertyGroup>
3232
<AssemblyTitle>S7CommPlusDriver</AssemblyTitle>

0 commit comments

Comments
 (0)