Created project contains lots of errors
I'm trying to create a base game in Linux but the created project has lots of errors.
Steps that I do:
- Follow the official docs for Ubuntu
- Create a new project:
dotnet new mgdesktopgl -o MyGame - 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
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?
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.
I get the same errors
May be related to #7611
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.
Quick update. I needed to add $HOME/.dotnet/tools/ to path to register and start it
Please refer to #8124 while this issue is being worked on.