Editing the DosBox config leads to an exception

Issue #6046 resolved
Carsten created an issue

Try to edit the dosbox config file assigned for a dosbox game brings up an exception:

Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)

App: LaunchBox
Version: 11.11
Type: System.IO.FileLoadException
Site: Void GetTypeByName(System.String, Boolean, Boolean, System.Runtime.CompilerServices.StackCrawlMarkHandle, System.Runtime.CompilerServices.ObjectHandleOnStack, Boolean, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.ObjectHandleOnStack)
Source: System.Private.CoreLib

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Resources.Extensions.DeserializingResourceReader.FindType(Int32 typeIndex)
at System.Resources.Extensions.DeserializingResourceReader.DeserializeObject(Int32 typeIndex)
at System.Resources.Extensions.DeserializingResourceReader._LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.Extensions.DeserializingResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.Extensions.DeserializingResourceReader.ResourceEnumerator.get_Entry()
at System.Resources.Extensions.DeserializingResourceReader.ResourceEnumerator.get_Current()
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.ApplyResources(Object value, String objectName, CultureInfo culture)
at System.ComponentModel.ComponentResourceManager.ApplyResources(Object value, String objectName)
at Unbroken.LaunchBox.Windows.Desktop.Forms.DosBoxConfigForm.CreateNotificationDispatcher(Object , Object , Object )
at Unbroken.LaunchBox.Windows.Desktop.Forms.DosBoxConfigForm.DisableTransactionPolicy()
at FieldIndexer.InsertHttpWorker(Object , FieldIndexer )
at Unbroken.LaunchBox.Windows.Desktop.Forms.DosBoxConfigForm..ctor(String confFilePath)
at Unbroken.LaunchBox.Windows.Desktop.ViewModels.AddEditGameDosBoxPageViewModel.DosboxConfigEditCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Recent Log:

17:23:08 Exception

Comments (21)

  1. Christian

    Those assemblies should be put in place during install. Could you rerun the 11.11 installer and point it to your current LaunchBox directory and let us know if it still occurs after that. Running in the installer does not affect your data at all so there is no cause for concern in that regard. Just make sure you point the installer to the LaunchBox folder and not \\LaunchBox\LaunchBox.

  2. Carsten reporter

    I have run the installer as you requested. The folder was set correctly but the exception still pops up.

  3. Christian

    Having problems replicating, could you tell me what exactly you are doing (what steps) to get this error? Is it happening EVERY time you do it or just every once in a while?

  4. Carsten reporter

    These are the steps to reproduce the error:

    1. Start Launchbox
    2. Pick any Dosbox driven game and right-click on it.
    3. Select “Bearbeiten” or “Edit” (I am using the german language)
    4. In the menu tree on the left select “Starten” → “Dosbox” / “Start” → “Dosbox”.
    5. In the path for the dosbox config file click on “Bearbeiten” / “Edit”.

    That brings up the error reliably every time.

  5. Christian

    Can you do a search in File Explorer in your LaunchBox directory for “System.Drawing” (without quotes) and tell me if you find any other results than that file? Also are you running any plugins or LB themes?

  6. Carsten reporter

    Hi Christian,

    I did the search you asked for and I did find:

    1. The file “System.Drawing.Common.dll” at “LaunchBox\Core” (of course)
    2. The file “CefSharp.WinForms.XML” located at “LaunchBox\ThirdParty\Chromium” (a match for content rather than filename)

    That was it. The second file did not contain anything that cought my eye (so no path to the file “System.Drawing.Common.dll” that was actually at another location or somesuch).

    I have quite a few themes installed for BigBox, but I assume you mean the themes for LaunchBox. For LaunchBox only the default ones are installed:

    • Default (that is the one I am using)
    • Old Default

    As far as I know I am running no Plugins. (Where would I have to check?)

    However, I have created an additional folder in LaunchBox, where I have put some files related to the emulation of the Roland MT32. But I assume that’s not an issue.

  7. Carsten reporter

    I am absolutely not into C# development, but I tried to validate that the assembly version is actuall the one the system is looking for. Looking at the properties of the assembly “System.Drawing.Common.dll” windows states the file version as 4.0.0.0 in the details tab, whereas the Exception raised in LaunchBox claims it did not find version 4.0.2.2. Does this make sense?

  8. Christian

    Yeah. Mine is the same version and I have no problems. Why I had you verify the file hash. Do you have any plugins or using any themes? If so could you try it without them and let me know if you still have the issue?

  9. Carsten reporter

    No, I am not using any LaunchBox themes, just the default ones I listed above. For BigBox I have quite a few installed and one in use. I will try to deactivate those as well if you like. I also have no plugins I know about. (Don‘t actually know yet how to install them.)

  10. Christian

    Big Box themes shouldn’t have an impact on this issue. And you would know if you had plugins installed (they go in your \\LaunchBox\Plugin\ folder)

  11. Christian

    Believe I have found the cause and have code fixes in place that will be released in the next beta. Unfortunately there is no work around for this error. If you need to use that window then you will need to revert to 11.10 where it should work. Let me know if you do revert to 11.10 and it does not fix the issue.

  12. Carsten reporter

    Hi Christian,

    great to hear. How can I revert to a previous version? Does that pose a risk?

    Can you tell what the root cause was?

    Best

    Carsten

  13. Christian

    The beta is out so you can choose to download that by opting in via LaunchBox options menu. If willing I would appreciate if you could update to the beta release and confirm that in that version the issue is resolved.

    To revert look in your \\LaunchBox\Updates folder for the set up and just point the setup to your current LaunchBox drive (making sure it doesn’t point to \\Launchbox\Launchbox\

    Root cause was that Visual Studio slipped in a dependency that wasn’t previously there (or intended to be there) when working on a large internal change. I couldn’t replicate because I have a newer DLL registered with the OS that I would assume you do not.

  14. Log in to comment