MonoGame MGCB Editor Crashes on Startup - Csharp

MGCB Editor crashes on startup whenever I attempt to edit a .mgcb file. Crash report linked below. I ensured that the most recent mgcb-editor is installed with the command line dotnet tool, and that the most recent MonoGame version is installed.

report.txt

What version of MonoGame does the bug occur on:

  • MonoGame 3.8.0.1641

What operating system are you using:

  • Mac Big Sur 11.0.1

What MonoGame platform are you using:

- DesktopGL

Asked Oct 23 '21 15:10
avatar LandenLloyd
LandenLloyd

9 Answer:

same on Big Sur. Running the tool from the command line reveals some detail:

MacOS ./mgcb-editor-mac Unhandled exception. System.TypeInitializationException: The type initializer for 'MonoGame.Tools.Pipeline.Global' threw an exception. ---> System.ArgumentException: Could not find a valid superclass for type NSImageRepGeometryProxy. Did you forget to register the bindings at MonoMac.ObjCRuntime.Class.Register() or call NSApplication.Init()? at MonoMac.ObjCRuntime.Class.Lookup(IntPtr klass, Boolean throwonerror) at MonoMac.ObjCRuntime.Class.Lookup(IntPtr klass) at MonoMac.ObjCRuntime.Runtime.GetNSObject(IntPtr ptr) at MonoMac.ObjCRuntime.Runtime.GetNSObjectT at MonoMac.AppKit.NSImage.BestRepresentationForDevice(NSDictionary deviceDescription) at Eto.Mac.Drawing.BitmapHandler.Create(Stream stream) at Eto.Drawing.Bitmap..ctor(Stream stream) at Eto.Drawing.Bitmap.FromResource(String resourceName, Assembly assembly) at MonoGame.Tools.Pipeline.Global..cctor() --- End of inner exception stack trace --- at MonoGame.Tools.Pipeline.Global.getUseHeaderBar() at MonoGame.Tools.Pipeline.LogWindow.InitializeComponent() at MonoGame.Tools.Pipeline.LogWindow..ctor() at MonoGame.Tools.Pipeline.Program.CommandLineInterface.Run(InvocationContext context, String project) at MonoGame.Tools.Pipeline.Utilities.CommandLineParser.<>cDisplayClass21.<.ctor>b1() at MonoGame.Tools.Pipeline.Utilities.CommandLineParser.Invoke(String[] args) at MonoGame.Tools.Pipeline.Program.Main(String[] args)

1
Answered Jan 02 '21 at 17:14
avatar  of meniku
meniku

Issue can be resolved by installing develop version:

dotnet nuget add source -n MonoGame http://teamcity.monogame.net/guestAuth/app/nuget/feed/_Root/default/v3/index.json
dotnet tool install --global dotnet-mgcb-editor --version 3.8.1.1941-develop
1
Answered May 03 '21 at 04:57
avatar  of vdmitrydev
vdmitrydev

Is this actually fixed? I installed last night and it just crashes on my Mac (Big Blur). I have it installed globally in ~/.dotnet/tools/mgcb-editor. I used the command dotnet tool install --global dotnet-mgcb-editor --version 3.8.0.1641 to install. I had noticed another closed issue suggesting to rename that binary to MGCB\ Editor but that also did not fix for me. I'm a bit confused because the path it mentions looks incorrect, but maybe I am wrong:

Process:               mgcb-editor-mac [2580]
Path:                  /Users/USER/*/mgcb-editor-mac.app/Contents/MacOS/mgcb-editor-mac
Identifier:            net.monogame.mgcb-editor
Version:               3.8.0.1641 (1)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           mgcb-editor-mac [2580]
User ID:               501

Date/Time:             2021-01-30 15:25:24.037 -0500
OS Version:            macOS 11.1 (20C69)
Report Version:        12
Bridge OS Version:     5.1 (18P3030)

Rest of the report:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff2033f462 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff2036d610 pthread_kill + 263
2   libsystem_c.dylib               0x00007fff202c0720 abort + 120
3   libcoreclr.dylib                0x000000010ce92129 PROCAbort + 25
4   libcoreclr.dylib                0x000000010ce92072 PROCEndProcess(void*, unsigned int, int) + 226
5   libcoreclr.dylib                0x000000010d175ead UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) + 893
6   libcoreclr.dylib                0x000000010d175f35 DispatchManagedException(PAL_SEHException&, bool) + 133
7   libcoreclr.dylib                0x000000010d0cf14d JIT_GetSharedNonGCStaticBase_Helper + 557
8   ???                             0x000000011cbde928 0 + 4777175336
9   ???                             0x000000011cbcb75d 0 + 4777097053
10  ???                             0x000000011cbbd286 0 + 4777038470
11  ???                             0x000000011bfc7eff 0 + 4764499711
12  ???                             0x000000011bfc68e2 0 + 4764494050
13  ???                             0x000000011bca7c4b 0 + 4761222219
14  ???                             0x000000011bc8ffe1 0 + 4761124833
15  libcoreclr.dylib                0x000000010d210c9b CallDescrWorkerInternal + 124
16  libcoreclr.dylib                0x000000010d05c919 MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1657
17  libcoreclr.dylib                0x000000010d05c919 MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned 
1
Answered Jan 30 '21 at 20:28
avatar  of rootVIII
rootVIII

@alex-hladun did you add source?

dotnet nuget add source -n MonoGame http://teamcity.monogame.net/guestAuth/app/nuget/feed/_Root/default/v3/index.json

I saw developer version after adding this.

1
Answered May 25 '21 at 05:45
avatar  of vdmitrydev
vdmitrydev

I think this may be related to #7401 which has been fixed in source but not yet released.

1
Answered Jan 12 '21 at 23:36
avatar  of jongalloway
jongalloway

(Disclaimer: Coming from another project, never used MGCB Editor, just found this via Google, this is my fix:) I think this is about an old version of the Eto framework, the MGCB Editor uses Eto version 2.5.2, I fixed this in my application by upgrading Eto to the latest version 2.5.9. The Could not find a valid superclass for type NSImageRepGeometryProxy error does not appear anymore, and the app starts - Eto's MacOS Big Sur compatibility was added after 2.5.2, as it looks.

1
Answered Jan 13 '21 at 07:55
avatar  of listm
listm

@harry-cpp hey thanks for the fix, any idea when this new version is going to be available to download

1
Answered Apr 19 '21 at 14:49
avatar  of eduardonunesp
eduardonunesp

I tried installing the development version. It looks as though the dotnet CLI is frozen. Can it be published on NuGet with the fix?

1
Answered May 11 '21 at 10:13
avatar  of ayousuf23
ayousuf23

Issue can be resolved by installing develop version:

dotnet nuget add source -n MonoGame http://teamcity.monogame.net/guestAuth/app/nuget/feed/_Root/default/v3/index.json
dotnet tool install --global dotnet-mgcb-editor --version 3.8.1.1941-develop

@vdmitrydev I can't install 3.8.1.1941-develop (doesn't seem to be in the nuget repository), any recommendations?

1
Answered May 25 '21 at 04:12
avatar  of alex-hladun
alex-hladun