Export (0) Print
Expand All

DllImportSearchPath Enumeration

.NET Framework 4.5

Specifies the paths that are used to search for DLLs that provide functions for platform invokes.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

[FlagsAttribute]
public enum DllImportSearchPath

Member nameDescription
Supported in .NET for Windows Store appsApplicationDirectoryInclude the application directory in the DLL search path.
Supported in .NET for Windows Store appsAssemblyDirectoryWhen searching for assembly dependencies, include the directory that contains the assembly itself, and search that directory first. This value is used by the .NET Framework, before the paths are passed to the Win32 LoadLibraryEx function.
Supported in .NET for Windows Store appsLegacyBehaviorSearch the application directory, and then call the Win32 LoadLibraryEx function with the LOAD_WITH_ALTERED_SEARCH_PATH flag. This value is ignored if any other value is specified. Operating systems that do not support the DefaultDllImportSearchPathsAttribute attribute use this value, and ignore other values.
Supported in .NET for Windows Store appsSafeDirectoriesInclude the application directory, the %WinDir%\System32 directory, and user directories in the DLL search path.
Supported in .NET for Windows Store appsSystem32Include the %WinDir%\System32 directory in the DLL search path.
Supported in .NET for Windows Store appsUseDllDirectoryForDependenciesSearch for the dependencies of a DLL in the folder where the DLL is located before searching other folders.
Supported in .NET for Windows Store appsUserDirectoriesInclude any path that was explicitly added to the process-wide search path by using the Win32 AddDllDirectory function.

Use the DefaultDllImportSearchPathsAttribute attribute to apply a set of paths to an entire assembly or to an individual platform invoke.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Windows Phone 8.1, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft