Skip to content

Commit 9bf945d

Browse files
committed
fix a error causing failed to load shared libs in .net fx
1 parent 6b99f89 commit 9bf945d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

build/00-common.linq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void DotNetRun(string args) => Run("dotnet", args.Dump(), Encoding.GetEnc
2121
static void Run(string exe, string args, Encoding encoding) => Util.Cmd(exe, args, encoding);
2222
static ProjectVersion[] Projects = new[]
2323
{
24-
new ProjectVersion("Sdcb.OpenVINO", "0.6.0"),
24+
new ProjectVersion("Sdcb.OpenVINO", "0.6.1"),
2525
new ProjectVersion("Sdcb.OpenVINO.Extensions.OpenCvSharp4", "0.2.0"),
2626
new ProjectVersion("Sdcb.OpenVINO.PaddleOCR", "0.5.1"),
2727
new ProjectVersion("Sdcb.OpenVINO.PaddleOCR.Models.Online", "0.2.1"),

src/Sdcb.OpenVINO/Natives/OpenVINOLibraryLoader.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ public static void Init()
4747

4848
internal static int VersionAbbr;
4949

50-
#if LINQPad || NETCOREAPP3_1_OR_GREATER
51-
5250
static OpenVINOLibraryLoader()
5351
{
52+
#if LINQPad || NETCOREAPP3_1_OR_GREATER
5453
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), OpenVINOImportResolver);
54+
#endif
5555
VersionAbbr = OVCore.Version.GetAbbreviatedVersion();
5656
}
5757

58+
#if LINQPad || NETCOREAPP3_1_OR_GREATER
59+
5860
private static IntPtr OpenVINOImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
5961
{
6062
if (libraryName == Dll)

0 commit comments

Comments
 (0)