Can't run a DesktopGL project on my Windows machine

The DesktopGL MonoGame.Framework assembly is referenced in my project. Upon attempting to debug it, the following error is thrown:

System.DllNotFoundException was unhandled
Message=Unable to load DLL 'SDL2.dll': The specified module could not be found. (Exception from HRESULT:   0x8007007E)
   at Sdl.GetVersion(Version& version)
   at Microsoft.Xna.Framework.SdlGamePlatform..ctor(Game game)
   at Microsoft.Xna.Framework.GamePlatform.PlatformCreate(Game game)
   at Microsoft.Xna.Framework.Game..ctor()

I tried employing several methods to install SDL2.dll, but everything I tried failed, for one reason or another.

  • I tried installing it via NuGet, but that gives me an error:
    PM> Install-Package sdl2 Install-Package : Could not install package 'sdl2.redist 2.0.5'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework.

  • I tried including it from my MonoGame install directory (Monogame/v3.0/Assemblies/DesktopGL/x64/SDL2.dll. I tried both the x64 and the x86 one, for good measure), and I get an error stating “…could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component”.

  • I tried downloading the dll from the libsdl website, and I get the same error as above. Again, tried x64 and x86 for good measure.

This project needs to be done with DesktopGL. Does anyone know why these errors are being thrown, and what could be done to get the project to run?

looks like a bug right now, this is a proposed solution

Same issue, with the same fix, happens on my end as well. Manually copying SDL2.dll from \MonoGame\v3.0\Assemblies\DesktopGL\x86 to the output folder of my game resolves the issue.