Skip to content

Initial binaries packaging - #8959

Merged
tomspilman merged 30 commits into
MonoGame:developfrom
SimonDarksideJ:feature/binariesdelivery
Aug 26, 2025
Merged

tomspilman merged 30 commits into
MonoGame:developfrom
SimonDarksideJ:feature/binariesdelivery

Conversation

@SimonDarksideJ

@SimonDarksideJ SimonDarksideJ commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

Summary

New packaging delivery to ship MonoGame as a Binaries delivery

Aims

To produce a pre-packaged version of all MonoGame deployments and dependencies in a single download.

Usage

Full docs are in the process for use, in the meantime, here is a sample/updated desktopgl project

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <PublishReadyToRun>false</PublishReadyToRun>
    <TieredCompilation>false</TieredCompilation>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <ApplicationIcon>../binariestest.Core/Content/Icon.ico</ApplicationIcon>
    <AssemblyName>binariestest</AssemblyName>
    <MonoGamePlatform>DesktopGL</MonoGamePlatform>
    <MonoGameBinariesPath Condition="'$(MonoGameBinariesPath)' == ''">$(MSBuildThisFileDirectory)..\..\MonoGame.3.8.4.2764-develop\MonoGame.Framework\</MonoGameBinariesPath>
  </PropertyGroup>
  <ItemGroup>
    <MonoGameContentReference Include="..\binariestest.Core\Content\binariestest.mgcb">
      <Link>Content\binariestest.mgcb</Link>
    </MonoGameContentReference>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\binariestest.Core\binariestest.Core.csproj" />
  </ItemGroup>
  <ItemGroup>
    <None Include="$(MonoGameBinariesPath)$(MonoGamePlatform)\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework">
      <HintPath>$(MonoGameBinariesPath)$(MonoGamePlatform)\MonoGame.Framework.dll</HintPath>
    </Reference>
  </ItemGroup>  
  <ItemGroup>
    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.*" />
  </ItemGroup>
</Project>

As well as an updated Content Builder Project usage, for content reference (platform specific) inclusions:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <MonoGameBinariesPath Condition="'$(MonoGameBinariesPath)' == ''">$(MSBuildThisFileDirectory)..\..\MonoGame.3.8.4.2764-develop\</MonoGameBinariesPath>    
  </PropertyGroup>

  <ItemGroup>
	<None Include="Assets/*" />
  </ItemGroup>
  <ItemGroup>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\windows-x64\bin\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="MIConvexHull" Version="1.1.19.1019" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework">
      <HintPath>$(MonoGameBinariesPath)MonoGame.Framework\Native\Release\MonoGame.Framework.dll</HintPath>
    </Reference>
    <Reference Include="MonoGame.Framework.Content.Pipeline">
      <HintPath>$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\MonoGame.Framework.Content.Pipeline.dll</HintPath>
    </Reference>
  </ItemGroup>
  
</Project>

Future updates

Current structure aligns with MonoGame output current deployment. Future work will restructure the output for easier consumption.

@tomspilman

Copy link
Copy Markdown
Member

@SimonDarksideJ it is hard to visualize what the structure here is. Can you screenshot it or provide a sample zip of it?

Also what is left to merge this?

@SimonDarksideJ

Copy link
Copy Markdown
Contributor Author

Also what is left to merge this?

A little more clean up is needed and obviously to test against a project to ensure all is well. Sorted out the duplications and simplified the structure now to the following:

Remaining:

  • Remove "publish" folder, it is more duplication from the NuGet packaging step
  • Flatted the "release" folders, not needed
image

@SimonDarksideJ

SimonDarksideJ commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

My Main concern with this single package approach are the "Runtimes" and "Platforms" folders within the Content Pipeline for the dependencies as these are still in a NuGet style approach @tomspilman , we use "nuget magic" to reference the correct libs.
It might need separate Binaries packages per OS.

Or may simply require a little extra work for the adopter to know which additional references to add to their projects.

For instance:
image

And the newer dxc deliverable, which ideally should be in the root folder, but it needs the one specific to the OS

@SimonDarksideJ

Copy link
Copy Markdown
Contributor Author

Partial success

Content building working with projects redirected to the local DLL's and the following added to the Content Builder csproj

  <ItemGroup>
    <None Include="..\MonoGame.3.8.4.2734-develop\MonoGame.Framework.Content.Pipeline\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="..\MonoGame.3.8.4.2734-develop\MonoGame.Framework.Content.Pipeline\windows-x64\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="..\MonoGame.3.8.4.2734-develop\MonoGame.Framework.Content.Pipeline\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

Room for improvement to reduce these include lines to two - Base + a Single Platform link

What is not working

The Binaries package is missing the runtime libs, like SDL2 for GL, which are not included in the base build. Likely some other NuGet magic.
So at runtime we are still missing DLL's/References that are needed in the Runtime output folder

@SimonDarksideJ
SimonDarksideJ marked this pull request as ready for review August 26, 2025 07:03
@SimonDarksideJ

Copy link
Copy Markdown
Contributor Author

Final layout for initial delivery, confirmed working on all platforms
image

Future updates will work on a restructure for easier adoption

@tomspilman
tomspilman merged commit 259950a into MonoGame:develop Aug 26, 2025
9 checks passed
@tomspilman tomspilman added this to the 3.8.5 milestone Jul 14, 2026
zignd pushed a commit to zigrok/MonoGame that referenced this pull request Jul 30, 2026
# Summary

New packaging delivery to ship MonoGame as a Binaries delivery

## Aims

To produce a pre-packaged version of all MonoGame deployments and
dependencies in a single download.

## Usage

Full docs are in the process for use, in the meantime, here is a
sample/updated desktopgl project

```
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <PublishReadyToRun>false</PublishReadyToRun>
    <TieredCompilation>false</TieredCompilation>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <ApplicationIcon>../binariestest.Core/Content/Icon.ico</ApplicationIcon>
    <AssemblyName>binariestest</AssemblyName>
    <MonoGamePlatform>DesktopGL</MonoGamePlatform>
    <MonoGameBinariesPath Condition="'$(MonoGameBinariesPath)' == ''">$(MSBuildThisFileDirectory)..\..\MonoGame.3.8.4.2764-develop\MonoGame.Framework\</MonoGameBinariesPath>
  </PropertyGroup>
  <ItemGroup>
    <MonoGameContentReference Include="..\binariestest.Core\Content\binariestest.mgcb">
      <Link>Content\binariestest.mgcb</Link>
    </MonoGameContentReference>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\binariestest.Core\binariestest.Core.csproj" />
  </ItemGroup>
  <ItemGroup>
    <None Include="$(MonoGameBinariesPath)$(MonoGamePlatform)\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework">
      <HintPath>$(MonoGameBinariesPath)$(MonoGamePlatform)\MonoGame.Framework.dll</HintPath>
    </Reference>
  </ItemGroup>  
  <ItemGroup>
    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.*" />
  </ItemGroup>
</Project>
```

As well as an updated Content Builder Project usage, for content
reference (platform specific) inclusions:

```
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <MonoGameBinariesPath Condition="'$(MonoGameBinariesPath)' == ''">$(MSBuildThisFileDirectory)..\..\MonoGame.3.8.4.2764-develop\</MonoGameBinariesPath>    
  </PropertyGroup>

  <ItemGroup>
	<None Include="Assets/*" />
  </ItemGroup>
  <ItemGroup>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\windows-x64\bin\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="MIConvexHull" Version="1.1.19.1019" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework">
      <HintPath>$(MonoGameBinariesPath)MonoGame.Framework\Native\Release\MonoGame.Framework.dll</HintPath>
    </Reference>
    <Reference Include="MonoGame.Framework.Content.Pipeline">
      <HintPath>$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\MonoGame.Framework.Content.Pipeline.dll</HintPath>
    </Reference>
  </ItemGroup>
  
</Project>
```

## Future updates

Current structure aligns with MonoGame output current deployment. Future
work will restructure the output for easier consumption.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants