dllMainReturnsFalse MDA

Note

This article is specific to .NET Framework. It doesn't apply to newer implementations of .NET, including .NET 6 and later versions.

The dllMainReturnsFalse managed debugging assistant (MDA) is activated if the managed DllMain function of a user assembly, called with reason DLL_PROCESS_ATTACH, returns FALSE.

Symptoms

The DllMain function returned FALSE, indicating that it did not execute properly. This can cause undetermined issues because DllMain functions typically contain important initialization code.

Cause

The DllMain function is called with reason DLL_PROCESS_ATTACH for DLL initialization upon load. If it returns FALSE, it means that DLL initialization failed.

Resolution

Analyze the code of the DllMain function of the failed DLL and identify the cause of the initialization failure.

Effect on the Runtime

This MDA has no effect on the CLR. It only reports data about the return value for DllMain.

Output

A message indicating that a DllMain function, called for reason DLL_PROCESS_ATTACH, returned FALSE. Note that this MDA is activated only if DllMain is implemented in managed code.

Configuration

<mdaConfig>
  <assistants>
    <dllMainReturnsFalse />
  </assistants>
</mdaConfig>

See also