Editing the DosBox config leads to an exception
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)
-
-
reporter I can make a backup before, no worries. Will let you know how it went.
-
reporter I have run the installer as you requested. The folder was set correctly but the exception still pops up.
-
Issue
#6047was marked as a duplicate of this issue. -
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?
-
reporter These are the steps to reproduce the error:
- Start Launchbox
- Pick any Dosbox driven game and right-click on it.
- Select “Bearbeiten” or “Edit” (I am using the german language)
- In the menu tree on the left select “Starten” → “Dosbox” / “Start” → “Dosbox”.
- In the path for the dosbox config file click on “Bearbeiten” / “Edit”.
That brings up the error reliably every time.
-
Still can’t replicate, even changed my language thinking maybe that was it. Would it be possible for you to go to https://emn178.github.io/online-tools/md5_checksum.html and then drag your \\Launchbox\Core\System.Drawing.Common.dll file to that window and let me know what hash it spits out? It should result in: 610cecc10625f4e5717afd976f75dcd8
-
reporter Hi Christian,
I can confirm my file file hases to 610cecc10625f4e5717afd976f75dcd8. It must be something else guess.
-
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?
-
reporter Hi Christian,
I did the search you asked for and I did find:
- The file “System.Drawing.Common.dll” at “LaunchBox\Core” (of course)
- 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.
-
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?
-
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?
-
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.)
-
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)
-
reporter I can confirm that there are no plugins installed.
-
Issue
#6060was marked as a duplicate of this issue. -
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.
-
- changed status to resolved
Corrected in 11.12 beta 1
-
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
-
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.
-
Issue
#6068was marked as a duplicate of this issue. - Log in to comment
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.