Skip to content

Fix Run macOs#84

Open
bhrama-br wants to merge 2 commits into
bernatvadell:optimizationsfrom
bhrama-br:fix-macos
Open

Fix Run macOs#84
bhrama-br wants to merge 2 commits into
bernatvadell:optimizationsfrom
bhrama-br:fix-macos

Conversation

@bhrama-br

@bhrama-br bhrama-br commented Mar 2, 2026

Copy link
Copy Markdown

Issue 1 — MGCB failure: "Wine is not installed"
Problem: The MonoGame 3.8.4.x HLSL shader compiler uses Wine on macOS to run fxc.exe (the DirectX compiler). Without Wine installed, all .fx file compilations failed.
Solution: Modified MuMac.csproj to detect the Operating System:

On Windows/CI: Runs MGCB normally (compiling the shaders).

On macOS: Skips MGCB and copies the pre-compiled .xnb files directly from the Client.Main/MGContent/bin/DesktopGL/Content/ folder.

Issue 2 — appsettings.json not found
Problem: Path.GetFullPath("appsettings.json") was resolving relative to the terminal's current working directory (e.g., /Users/bramante/) instead of the executable's directory.
Solution: Replaced with AppContext.BaseDirectory in MuGame.cs, which consistently points to the directory where the executable is located.

Important Note — Missing Shaders
The .xnb files for the .fx shaders (AlphaRGB, FXAA, Shadow, etc.) do not exist yet in the pre-compiled folder. They must be generated at least once on Windows/CI. When the CI runs build-macos (which already executes on windows-latest), the shaders will be compiled. After that, simply commit the generated .xnb files to the repository (the .gitignore has already been configured to track these files).

@bhrama-br bhrama-br changed the base branch from main to optimizations March 2, 2026 09:56
@xulek

xulek commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

please change comments to English in the code

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