Install a development MonoGame build

Do you want to build your game with MonoGame’s latest and greatest develop branch? You don’t need to wait for official MonoGame releases.

Each time a new commit makes it into the MonoGame develop branch, new builds are automatically released to the MonoGame GitHub NuGet feed. To install them into a project, you can execute the following commands. Note that some of them can take some time to complete as large files are downloaded.

  1. Generate a Personal access tokens (classic): https://github.com/settings/tokens.
    • Make sure that it has the read:packages scope.
  2. Add the MonoGame GitHub NuGet feed. Replace USERNAME with your GitHub username and TOKEN with the generated access token from above:
    dotnet nuget add source -n MonoGameGitHub https://nuget.pkg.github.com/MonoGame/index.json --username USERNAME --password TOKEN
    
  3. Find the version you want:
    dotnet package search MonoGame.Framework.DesktopGL --source MonoGameGitHub --prerelease --exact-match
    
    You can also browse them at https://github.com/orgs/MonoGame/packages?repo_name=MonoGame.
  4. From the folder with your game’s .csproj, install that version:
    dotnet add package MonoGame.Framework.DesktopGL --version THE-VERSION
    dotnet add package MonoGame.Content.Builder.Task --version THE-VERSION
    
  5. To install the matching templates:
    dotnet new install MonoGame.Templates.CSharp::THE-VERSION
    
    With that you will be able to use dotnet new mgdesktopgl -o MyGame.

You can repeat step 3 to 5 whenever you want to update.

Pass the version explicitly rather than reaching for --prerelease. The develop packages don’t share a numbering scheme with the releases on nuget.org, so --prerelease can resolve to the latest stable release instead of a develop build and leave you wondering why nothing changed.

If you want something newer than the last release without running the raw develop code, MonoGame also publishes preview packages to nuget.org under versions like 3.8.5-preview.7. Those you can install with --prerelease from the normal feed, no token needed.

To remove the GitHub source from step 2, you can do:

dotnet nuget remove source MonoGameGitHub

Read more

Edit this page on GitHub