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

Weird error from MonoGame.Content.Builder.Task #8519

Open
2 tasks done
tomspilman opened this issue Oct 6, 2024 · 0 comments
Open
2 tasks done

Weird error from MonoGame.Content.Builder.Task #8519

tomspilman opened this issue Oct 6, 2024 · 0 comments

Comments

@tomspilman
Copy link
Member

Prerequisites

  • I have verified this issue is present in the develop branch
  • I have searched open and closed issues to ensure it has not already been reported.

MonoGame Version

3.8.x

Which MonoGame platform are you using?

N/A

Operating System

Windows

Description

You get a weird error message with an exception in it when you specify the wrong target platform in MGCB when using the MonoGame.Content.Builder.Task in your project.

Steps to Reproduce

Add the wrong target platform to MGCB.

Minimal Example Repo

No response

Expected Behavior

Better error message.

Resulting Behavior

You get this error message:

2>------ Build started: Project: FrameworkTests, Configuration: Debug Any CPU ------
2>MonoGame Content Builder
2>Builds optimized game content for MonoGame projects.
2>
2>Invalid value 'Switch2' for option 'platform'
2>
2>Usage: dotnet <Options>
2>
2>Options:
2>Unhandled exception. System.IO.IOException: The handle is invalid.
2>   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
2>   at MonoGame.Content.Builder.MGBuildParser.ShowError(String message, Object[] args) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\Tools\MonoGame.Content.Builder\CommandLineParser.cs:line 570
2>   at MonoGame.Content.Builder.MGBuildParser.SetOption(MemberInfo member, String value) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\Tools\MonoGame.Content.Builder\CommandLineParser.cs:line 404
2>   at MonoGame.Content.Builder.MGBuildParser.ParseArgument(String arg) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\Tools\MonoGame.Content.Builder\CommandLineParser.cs:line 347
2>   at MonoGame.Content.Builder.MGBuildParser.ParseFlags(String arg) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\Tools\MonoGame.Content.Builder\CommandLineParser.cs:line 278
2>   at MonoGame.Content.Builder.MGBuildParser.Parse(IEnumerable`1 args) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\Tools\MonoGame.Content.Builder\CommandLineParser.cs:line 140
2>   at MonoGame.Content.Builder.Program.Main(String[] args) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\Tools\MonoGame.Content.Builder\Program.cs:line 35
2>C:\Users\tom\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\MonoGame.Content.Builder.Task.targets(138,5): error MSB3073: The command "dotnet C:\Users\tom\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\\..\tools\netcoreapp3.1\any\mgcb.dll /quiet /@:"D:\Projects\xxxxx\FrameworkTests\Content\content.mgcb" /platform:Switch2 /outputDir:"D:/Projects/xxxxx/FrameworkTests/Content/bin/Switch2/content" /intermediateDir:"D:/Projects/xxxxx/FrameworkTests/Content/obj/Switch2/content" /workingDir:"D:/Projects/xxxxx/FrameworkTests/Content/"" exited with code -532462766.
2>Done building project "FrameworkTests.csproj" -- FAILED.

Which is weird... that exception shouldn't be happening. It should also probably tell you what the correct platforms are.

Files

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant