Closed pompiamp closed 4 years ago
Adding a parent folder to assembly search is something of a security problem. However, if the name if the folder you are dropping is "bin", it seems much safer. How about using an "if" statement to verify the folder is named "bin", then yield return Path.Combine( Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory), "runtimes", PlatformRuntimePrefix.Value + "-" + ArchitectureSubdir.Value, "native")
?
I would accept a pull request for this.
Adding a parent folder to assembly search is something of a security problem. However, if the name if the folder you are dropping is "bin", it seems much safer. How about using an "if" statement to verify the folder is named "bin", then
yield return Path.Combine( Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory), "runtimes", PlatformRuntimePrefix.Value + "-" + ArchitectureSubdir.Value, "native")
?I would accept a pull request for this.
Thanks @lilith I've sent a PR: https://github.com/imazen/imageflow-dotnet/pull/18
I've released your changes with 0.7.2. Thank you so much!
Hi, We are having an exception when loading nativeRuntime in azure functions (.net core 2.0).
This is the exception
Looking for "imageflow.dll" Subdir="x86", IsUnix=False, IsDotNetCore=True Before searching: Unable to load DLL 'imageflow' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E) File not found: D:\Program Files (x86)\SiteExtensions\Functions\2.0.14248\32bit\x86\imageflow.dll File not found: D:\Program Files (x86)\SiteExtensions\Functions\2.0.14248\32bit\imageflow.dll File not found: D:\home\site\wwwroot\bin\x86\imageflow.dll File not found: D:\home\site\wwwroot\bin\imageflow.dll File not found: D:\Program Files (x86)\SiteExtensions\Functions\2.0.14248\32bit\runtimes\win-x86\native\x86\imageflow.dll File not found: D:\Program Files (x86)\SiteExtensions\Functions\2.0.14248\32bit\runtimes\win-x86\native\imageflow.dll File not found: D:\home\site\wwwroot\bin\runtimes\win-x86\native\x86\imageflow.dll File not found: D:\home\site\wwwroot\bin\runtimes\win-x86\native\imageflow.dll at Imageflow.Bindings.NativeMethods.imageflow_context_create(UInt32 imageflow_abi_ver_major, UInt32 imageflow_abi_ver_minor) at Imageflow.Bindings.JobContextHandle.<>c.<.ctor>b__0_0() at Imageflow.Bindings.NativeLibraryLoader.FixDllNotFoundException[T](String basename, Func
1 invokingOperation, IEnumerable1 customSearchDirectories)
Is similar to this Issue
13
These are our references:
If we dig into our deployments paths in azure we can find the runtime (imageflow.dll) at this location:
D:\home\site\wwwroot\runtimes\win-x86\native\imageflow.dll
But it does not exists in the paths that imageflow is trying to get.
We've looked at the FixDllNotFoundException method and thought about this possible fix (adding this path):
yield return Path.Combine( Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory), "runtimes", PlatformRuntimePrefix.Value + "-" + ArchitectureSubdir.Value, "native");
another solution we've thought, is to be able to pass a
customSearchDirectories
param to the JobContextHandle's constructor