MonoGame icon indicating copy to clipboard operation
MonoGame copied to clipboard

Created project contains lots of errors

Open svprdga opened this issue 4 years ago • 7 comments

I'm trying to create a base game in Linux but the created project has lots of errors.

Steps that I do:

  1. Follow the official docs for Ubuntu
  2. Create a new project: dotnet new mgdesktopgl -o MyGame
  3. Try to run the project with dotnet run

Once I open the project in VSCode I see lots of errors:

The type or namespace name 'Microsoft' could not be found (are you missing a using directive or an assembly reference?) [MyGame]
Predefined type 'System.Object' is not defined or imported [MyGame]
[...]

When I try to run the project I got:

/home/svprdga/.nuget/packages/monogame.content.builder.task/3.8.0.1641/build/MonoGame.Content.Builder.Task.targets(138,5): error MSB3073: The command "dotnet /home/svprdga/.nuget/packages/monogame.content.builder.task/3.8.0.1641/build//../tools/netcoreapp3.1/any/mgcb.dll /quiet /@:"/home/svprdga/code/personal/monogame/MyGame/Content/Content.mgcb" /platform:DesktopGL /outputDir:"/home/svprdga/code/personal/monogame/MyGame/Content/bin/DesktopGL/Content" /intermediateDir:"/home/svprdga/code/personal/monogame/MyGame/Content/obj/DesktopGL/Content" /workingDir:"/home/svprdga/code/personal/monogame/MyGame/Content/"" exited with code 150. [/home/svprdga/code/personal/monogame/MyGame/MyGame.csproj]

The build failed. Fix the build errors and run again.

What version of MonoGame does the bug occur on:

  • MonoGame 3.8

What operating system are you using:

  • Linux Mint

What MonoGame platform are you using:

  • DesktopGL

svprdga avatar Oct 28 '21 10:10 svprdga

VSCode c# is something i'd never touch with a 20 foot pole, but there's a very similar thing in Rider when you have the wrong MSBuild selected (aka using Mono instead of dotnet core), could it be the same issue?

Beyley avatar Oct 28 '21 10:10 Beyley

VSCode c# is something i'd never touch with a 20 foot pole, but there's a very similar thing in Rider when you have the wrong MSBuild selected (aka using Mono instead of dotnet core), could it be the same issue?

No, because I intend to launch the game from the CLI. In this case VSCode does nothing regarding the building or compiling it.

svprdga avatar Oct 28 '21 13:10 svprdga

I get the same errors

ElectroGamesDev avatar Oct 28 '21 21:10 ElectroGamesDev

May be related to #7611

TheAirBlow avatar Nov 02 '21 16:11 TheAirBlow

I had the same issue on a Raspberry PI (Raspbian GNU/Linux 11 (bullseye)) but fixed it my installing the dotnet 3.1 SDK.

Still can't get the mgcb-editor to register, but at least the project runs.

dojojon avatar Nov 13 '21 18:11 dojojon

Quick update. I needed to add $HOME/.dotnet/tools/ to path to register and start it

dojojon avatar Nov 13 '21 18:11 dojojon

Please refer to #8124 while this issue is being worked on.

ThomasFOG avatar Jan 19 '24 14:01 ThomasFOG