Indicates whether the callee calls the SetLastError Win32 API function before returning from the attributed method.
Assembly: mscorlib (in mscorlib.dll)
true to indicate that the callee will call SetLastError; otherwise, false. The default is false.
The runtime marshaler calls GetLastError and caches the value returned to prevent it from being overwritten by other API calls. You can retrieve the error code by calling GetLastWin32Error.
In some cases, Visual Basic developers use the DllImportAttribute, instead of using the Declare statement, to define a DLL function in managed code. Setting the field is one of those cases.
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1