0
私はいくつかのクラウドディレクトリにあるdllをラッパーしようとしています。インターネット上のいくつかのリンクからdllをラッパー
private SafeLibraryHandle sevenZipSafeHandle;
public SevenZipHandle(string sevenZipLibPath)
{
this.sevenZipSafeHandle = Kernel32Dll.LoadLibrary(sevenZipLibPath);
if (this.sevenZipSafeHandle.IsInvalid)
{
throw new Win32Exception();
}
}
}
internal static class Kernel32Dll
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern SafeLibraryHandle LoadLibrary([MarshalAs(UnmanagedType.LPTStr)] string lpFileName);
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
internal static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string procName);
[SuppressUnmanagedCodeSecurity]
[DllImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool FreeLibrary(IntPtr hModule);
}
私はdllファイルを検証していますが、私が使用している場合:
sevenZipLibPath = “c:/temp/file.dll”
それが正常に動作します。
しかし、のようなインターネット上にあるいくつかのファイルを使用する場合:
sevenZipLibPath = “"http://any.blob.core.windows.net/files/file.dll”
それは動作しませんが。
このような状況で、クラウドドライブからDLLファイルを確認するにはどうすればよいですか?
青空関数について考える。その一時的な場所はどのようになりますか? – Billy
ファイルをtempPathにダウンロードしました。私はコンソールプロジェクトでそれを実行する場合、それは正常に動作します。しかし、私がAzure Functionプロジェクトでそれを実行すると、ファイルはLoadLibraryから "isInvalid"を返します。 – Billy