MonoGame.Content.Builder.Task.targets(138, 5): [MSB3073] The command "dotnet /home/vfrz/.nuget/packages/monogame.content.builder.task/188.8.131.521/build/../tools/netcoreapp3.1/any/mgcb.dll /quiet /@:"/run/media/vfrz/Shared/GameDev/ProjectSommar/src/ProjectSommar/Content/GameContent.mgcb" /platform:DesktopGL /outputDir:"/run/media/vfrz/Shared/GameDev/ProjectSommar/src/ProjectSommar/Content/bin/DesktopGL/GameContent" /intermediateDir:"/run/media/vfrz/Shared/GameDev/ProjectSommar/src/ProjectSommar/Content/obj/DesktopGL/GameContent" /workingDir:"/run/media/vfrz/Shared/GameDev/ProjectSommar/src/ProjectSommar/Content/"" exited with code 127.
This is surely due to Rider, when I run it with user “root” I don’t have this problem but this is not a great solution. I can run the command dotnet build and dotnet run without any problem too.
Has anyone else encountered this problem? (And found a solution?)
Take the command printed in the output into your clipboard.
Paste into a terminal session. Note: If you are on Windows, I highly recommend downloading Windows Subsystem for Linux and Windows Terminal. You can now do stuff in terminal in a cross-platform manner.
Observe the output of the running pipeline tool. It will complain and print more useful information then what is shown here.
Thanks for your help. I’ve already tried to copy/paste and execute the command into my terminal, it works fine. I am using Linux Manjaro.
So I’ve googled about what exit code 127 means, and it turns out to be about “command not found”. The problem is the command dotnet, I don’t really know why it does not work using my normal user and work with root user.
I fixed this by modifying the MonoGame.Content.Builder.Task.props file from the NuGet package from: <DotnetCommand Condition="'$(DotnetCommand)' == ''">dotnet</DotnetCommand>
to <DotnetCommand Condition="'$(DotnetCommand)' == ''">/opt/dotnet/dotnet</DotnetCommand>
Now it works perfectly.
Thanks for your help and hope it can be useful to others
My dotnet folder has always been in the opt folder. I don’t use any package for it, I install it manually because sometimes I need to install daily builds of .NET 5.
I believe the problem is that Rider is executing the command in a strange context where it can’t found the dotnet command without the full path to it.