Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created project contains lots of errors #7610

Open
svprdga opened this issue Oct 28, 2021 · 7 comments
Open

Created project contains lots of errors #7610

svprdga opened this issue Oct 28, 2021 · 7 comments
Labels
Linux MacOS Setup Related to setuping a MonoGame project for the first time

Comments

@svprdga
Copy link

svprdga commented Oct 28, 2021

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
@Beyley
Copy link

Beyley commented Oct 28, 2021

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?

@svprdga
Copy link
Author

svprdga commented Oct 28, 2021

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.

@ElectroGamesDev
Copy link

I get the same errors

@TheAirBlow
Copy link

May be related to #7611

@dojojon
Copy link

dojojon commented Nov 13, 2021

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
Copy link

dojojon commented Nov 13, 2021

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

@mrhelmut mrhelmut added Linux MacOS Setup Related to setuping a MonoGame project for the first time labels Jan 19, 2024
@mrhelmut
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux MacOS Setup Related to setuping a MonoGame project for the first time
Projects
None yet
Development

No branches or pull requests

6 participants