Skip to content

Running "mgcb-editor --register" on a Mac a second time causes exception #7309

@SimonDarksideJ

Description

@SimonDarksideJ

When you run the mgcb-editor register command on a Mac a second time, it results in an exception because the .plist file already exists.
While granted this shouldn't be needed, the error should be a lot more use friendly and not an exception.

Failed to register MGCB Editor
Unhandled exception: System.IO.IOException: The file '/Users/simonjacksonbw/Applications/MGCB Editor.app/Contents/Info.plist' already exists.
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
   at MonoGame.Tools.Pipeline.FileAssociation.CopyDirectory(String sourceDirName, String destDirName)
   at MonoGame.Tools.Pipeline.FileAssociation.CopyDirectory(String sourceDirName, String destDirName)
   at MonoGame.Tools.Pipeline.FileAssociation.InstallApplic
ation()
   at MonoGame.Tools.Pipeline.FileAssociation.Associate()
   at MonoGame.Tools.Pipeline.Program.CommandLineInterface.Register(InvocationContext context)
   at MonoGame.Tools.Pipeline.Utilities.CommandLineParser.<>c__DisplayClass5_0.<<CreateShortCircuitMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__9_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseExceptionHandler>b__0>d.MoveNext()

What version of MonoGame does the bug occur on:

  • MonoGame 3.8

What operating system are you using:

  • Mac

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions