DllImportSearchPath 列舉

定義

指定用來搜尋提供平台叫用函式之 DLL 的路徑。

此列舉支援其成員值的位元組合。

public enum class DllImportSearchPath
[System.Flags]
public enum DllImportSearchPath
[<System.Flags>]
type DllImportSearchPath = 
Public Enum DllImportSearchPath
繼承
DllImportSearchPath
屬性

欄位

ApplicationDirectory 512

將應用程式目錄包含在 DLL 搜尋路徑中。

AssemblyDirectory 2

當搜尋組件相依性時,會包括內含組件本身的目錄,並優先搜尋該目錄。 在原生 AOT 和單一檔案部署模型中使用時,應用程式的安裝目錄會被視為「元件目錄」並搜尋。

LegacyBehavior 0

搜尋應用程式目錄,然後使用 旗標呼叫 Win32 LoadLibraryEx 函LOAD_WITH_ALTERED_SEARCH_PATH 式。 如果沒有指定其他值,會忽略此值。 不支援 DefaultDllImportSearchPathsAttribute 屬性的作業系統會使用此值,而忽略其他值。

SafeDirectories 4096

將應用程式目錄、%WinDir%\System32 目錄和使用者目錄包含在 DLL 搜尋路徑中。

System32 2048

%WinDir%\System32 目錄包含在 DLL 搜尋路徑中。

UseDllDirectoryForDependencies 256

搜尋其他資料夾之前,先在 DLL 所在的資料夾中搜尋 DLL 的相依性。

UserDirectories 1024

使用 Win32 AddDllDirectory 函式,包含明確新增至全進程搜尋路徑的任何路徑。

備註

DefaultDllImportSearchPathsAttribute使用 屬性,將一組路徑套用至整個元件或個別平臺叫用。

適用於