0

I'm trying to install MonoGame for mac and VS code. I followed the instructions at https://docs.monogame.net/articles/getting_started/1_setting_up_your_development_environment_macos.html, but I am stuck at one place. I have the monogame editor .mpack file, but can't upload it to VS code for some reason. I did extensive research but can't find any answers. What should I do?

5
  • Visual Studio Code != Visual Studio Commented Mar 10, 2022 at 2:29
  • Perhaps try this guide. Commented Mar 10, 2022 at 2:30
  • Sorry, I didn’t make the question clear enough. I understand VS code != Visual Studio, that’s why I’m asking this question. I just need to figure out why I can’t upload a .mpack extension that is on the Monogame Mac starterpack, and for some reason VS code won’t let me install it. Commented Mar 10, 2022 at 2:51
  • I might be wrong, but isn't .mpack a Visual Studio thing, not a Visual Studio Code thing? Commented Mar 10, 2022 at 3:46
  • Yep, you are right. I tried converting to a .vsix, doesn’t work on Mac. Thanks for trying to help though :) Commented Mar 10, 2022 at 6:24

1 Answer 1

0

The "normal" Mac install instructions and files are only for use with Visual Studio.

Install using CLI

Please note these instructions are designed for Intel Macs(x64), but should work on Apple Silicon devices(ARM) with .Net6.

You can roughly follow the Linux install instructions.

  1. Install Dot Net Core 3.1 for the Mac. or .Net6

  2. Install VS Code.

  3. You may need to reference this question on Terminal paths for code. Something similar may need to be done below for the dotnet command.

    a. Install the C# extensions: code --install-extension ms-dotnettools.csharp

  4. (Optional) Install Mono. Required for some consoles and Android targets(Frameworks 4.5 and 4.7). See here for compatability.

  5. Open a terminal window. Run the following line, either the OS or from VS Code:

dotnet new --install MonoGame.Templates.CSharp

The next two lines may be Linux specific so ignore any uncorrectable errors.

dotnet tool install --global dotnet-mgcb-editor
mgcb-editor --register

At this point, you should be able to create a new CLI project folder from the templates:

cd /path/togame/parent
dotnet new mgdesktopgl -o MyGame

Open the folder in VS Code.

Review the projectname.csproj file:

Note the TargetFramework line: <TargetFramework>netcoreapp3.1</TargetFramework> or <TargetFramework>net6.0</TargetFramework>

Some targets require a different TargetFramework, like net47 or net45 as provided by Mono.

See Microsoft's .Net versioning page for more information.


A couple of additional helpful CLI commands to run from the folder with the .proj file; Taken from this list:

dotnet restore Update all NuGet Packages

dotnet clean Remove all output files

dotnet build compile

dotnet run execute the program

Sign up to request clarification or add additional context in comments.

2 Comments

Please let me know of any corrections I need to make, and the version of Mac you are running.
Preliminary reports, github.com/MonoGame/MonoGame/issues/7632 , suggest that the net6.0 versions of the nuget packages are available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.