This project demonstrates a cross-platform MonoGame 3.8.* sample, structured for modern .NET 8+ development. It supports Windows, DesktopGL, Android, and iOS platforms, using a clean separation of shared and platform-specific code.
/Core # Shared game logic and components
/Platforms/Windows # Windows-specific entry point and project
/Platforms/Desktop # DesktopGL-specific entry point and project
/Platforms/Android # Android-specific entry point, manifest, and project
/Platforms/iOS # iOS-specific entry point, Info.plist, and project
/Content # Pre-built .xnb content files
- .NET 8 SDK or newer
- Visual Studio 2022+ (for Android/iOS) or VSCode
- MonoGame 3.8.* NuGet packages (restored automatically)
- Android/iOS build tools for mobile platforms
- Open
GameComponents.sln. - Select the desired platform project (Windows, DesktopGL, Android, or iOS).
- Build and run as usual.
- Open the root folder in VSCode.
- Use the provided tasks (see below) to build or run each platform:
- Windows:
dotnet run --project Platforms/Windows/GameComponents.Windows.csproj - DesktopGL:
dotnet run --project Platforms/Desktop/GameComponents.DesktopGL.csproj - Android:
dotnet build Platforms/Android/GameComponents.Android.csproj - iOS:
dotnet build Platforms/iOS/GameComponents.iOS.csproj
- Windows:
- Uses pre-built
.xnbfiles in/Content. - No
Content.mgcbis required.
- All shared code is in
/Coreand referenced by each platform project. - Platform-specific code and entry points are in their respective
/Platforms/*directories. - Only Windows, DesktopGL, Android, and iOS are supported (no Linux, MacOS, or PSMobile).
- Ensure all required SDKs and build tools are installed for your target platform.
- If you encounter build errors, run
dotnet restorefirst.
For more details, see the individual project files and platform directories.