[GH-ISSUE #1089] [Bug] ScreentoGif ARM64 won't start, throws exception #821

Closed
opened 2026-02-26 09:32:45 +03:00 by kerem · 7 comments
Owner

Originally created by @rustedwizard on GitHub (Mar 11, 2022).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1089

Originally assigned to: @NickeManarin on GitHub.

I have Screentogif 3.26 installed on Surface pro x (with .net 6.0.201 installed). When I try to start it, nothing happens (screentogif process showed up in task manger). In log folder I found following log:

► Title - 
	On dispacher unhandled exception - Unknown
▬ Message - 
	An attempt was made to load a program with an incorrect format. (0x8007000B)
○ Type - 
	System.BadImageFormatException
♦ [Version] Date/Hour - 
	[2.36] 03/10/2022 20:23:27
▲ Source - 
	PresentationCore
▼ TargetSite - 
	Void RenderOptions_ForceSoftwareRenderingModeForProcess(Boolean)
► Fuslog - 
	
♠ StackTrace - 
   at MS.Win32.PresentationCore.UnsafeNativeMethods.MilCoreApi.RenderOptions_ForceSoftwareRenderingModeForProcess(Boolean fForce)
   at System.Windows.Media.RenderOptions.set_ProcessRenderMode(RenderMode value)
   at ScreenToGif.App.App_Startup(Object sender, StartupEventArgs e) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 156
   at System.Windows.Application.OnStartup(StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   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)

----------------------------------

► Title - 
	Error while displaying the error.
▬ Message - 
	Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception.
○ Type - 
	System.Windows.Markup.XamlParseException
♦ [Version] Date/Hour - 
	[2.36] 03/10/2022 20:23:27
▲ Source - 
	PresentationFramework
▼ TargetSite - 
	Void RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
♠ StackTrace - 
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at ScreenToGif.Windows.Other.ExceptionDialog.InitializeComponent() in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\Windows\Other\ExceptionDialog.xaml:line 1
   at ScreenToGif.Windows.Other.ExceptionDialog..ctor(Exception exception) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\Windows\Other\ExceptionDialog.xaml.cs:line 21
   at ScreenToGif.Windows.Other.ExceptionDialog.Ok(Exception exception, String title, String instruction, String observation, Boolean bugWith4055002) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\Windows\Other\ExceptionDialog.xaml.cs:line 101
   at ScreenToGif.App.<>c__DisplayClass21_0.<ShowException>b__0() in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 433
   at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke(Action callback)
   at ScreenToGif.App.ShowException(Exception exception) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 428
   at ScreenToGif.App.App_DispatcherUnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 238

▬▬ Message - 
	An attempt was made to load a program with an incorrect format. (0x8007000B)
○○ Type - 
	System.BadImageFormatException
▲▲ Source - 
	PresentationCore
▼▼ TargetSite - 
	Void .ctor(System.Windows.Media.MediaContext)
♠♠ StackTrace - 
   at System.Windows.Media.MediaContextNotificationWindow..ctor(MediaContext ownerMediaContext)
   at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)
   at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)
   at System.Windows.Media.Visual.VerifyAPIReadWrite()
   at System.Windows.Media.VisualCollection.Add(Visual visual)
   at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
   at System.Windows.Controls.UIElementCollection.Add(UIElement element)
   at System.Windows.Controls.UIElementCollection.System.Collections.IList.Add(Object value)
   at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance, Object item)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)

----------------------------------
Originally created by @rustedwizard on GitHub (Mar 11, 2022). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1089 Originally assigned to: @NickeManarin on GitHub. I have Screentogif 3.26 installed on Surface pro x (with .net 6.0.201 installed). When I try to start it, nothing happens (screentogif process showed up in task manger). In log folder I found following log: ``` ► Title - On dispacher unhandled exception - Unknown ▬ Message - An attempt was made to load a program with an incorrect format. (0x8007000B) ○ Type - System.BadImageFormatException ♦ [Version] Date/Hour - [2.36] 03/10/2022 20:23:27 ▲ Source - PresentationCore ▼ TargetSite - Void RenderOptions_ForceSoftwareRenderingModeForProcess(Boolean) ► Fuslog - ♠ StackTrace - at MS.Win32.PresentationCore.UnsafeNativeMethods.MilCoreApi.RenderOptions_ForceSoftwareRenderingModeForProcess(Boolean fForce) at System.Windows.Media.RenderOptions.set_ProcessRenderMode(RenderMode value) at ScreenToGif.App.App_Startup(Object sender, StartupEventArgs e) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 156 at System.Windows.Application.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__1_0(Object unused) 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) ---------------------------------- ► Title - Error while displaying the error. ▬ Message - Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception. ○ Type - System.Windows.Markup.XamlParseException ♦ [Version] Date/Hour - [2.36] 03/10/2022 20:23:27 ▲ Source - PresentationFramework ▼ TargetSite - Void RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri) ♠ StackTrace - at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at ScreenToGif.Windows.Other.ExceptionDialog.InitializeComponent() in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\Windows\Other\ExceptionDialog.xaml:line 1 at ScreenToGif.Windows.Other.ExceptionDialog..ctor(Exception exception) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\Windows\Other\ExceptionDialog.xaml.cs:line 21 at ScreenToGif.Windows.Other.ExceptionDialog.Ok(Exception exception, String title, String instruction, String observation, Boolean bugWith4055002) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\Windows\Other\ExceptionDialog.xaml.cs:line 101 at ScreenToGif.App.<>c__DisplayClass21_0.<ShowException>b__0() in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 433 at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke(Action callback) at ScreenToGif.App.ShowException(Exception exception) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 428 at ScreenToGif.App.App_DispatcherUnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e) in C:\Users\nicke\source\repos\ScreenToGif\ScreenToGif\App.xaml.cs:line 238 ▬▬ Message - An attempt was made to load a program with an incorrect format. (0x8007000B) ○○ Type - System.BadImageFormatException ▲▲ Source - PresentationCore ▼▼ TargetSite - Void .ctor(System.Windows.Media.MediaContext) ♠♠ StackTrace - at System.Windows.Media.MediaContextNotificationWindow..ctor(MediaContext ownerMediaContext) at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher) at System.Windows.Media.MediaContext.From(Dispatcher dispatcher) at System.Windows.Media.Visual.VerifyAPIReadWrite() at System.Windows.Media.VisualCollection.Add(Visual visual) at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element) at System.Windows.Controls.UIElementCollection.Add(UIElement element) at System.Windows.Controls.UIElementCollection.System.Collections.IList.Add(Object value) at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance, Object item) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType) ---------------------------------- ```
Author
Owner

@NickeManarin commented on GitHub (Mar 14, 2022):

Which version did you download?

Portable
Portable (light)
Installer (MSI)
Installer (MSI, light)
Package (MSIX)

Have you tried to use the others?

<!-- gh-comment-id:1066215583 --> @NickeManarin commented on GitHub (Mar 14, 2022): Which version did you download? Portable Portable (light) Installer (MSI) Installer (MSI, light) Package (MSIX) Have you tried to use the others?
Author
Owner

@rustedwizard commented on GitHub (Mar 14, 2022):

MSI, I haven't tried others

<!-- gh-comment-id:1066228059 --> @rustedwizard commented on GitHub (Mar 14, 2022): MSI, I haven't tried others
Author
Owner

@rustedwizard commented on GitHub (Mar 19, 2022):

I just tried MSIX (from Store), same behavior

<!-- gh-comment-id:1072954867 --> @rustedwizard commented on GitHub (Mar 19, 2022): I just tried MSIX (from Store), same behavior
Author
Owner

@ac1982 commented on GitHub (Apr 8, 2022):

same problem here in windows 11 arm64 on Surface Pro X. ScreentoGif was installed from Microsoft store.
Logs.zip

<!-- gh-comment-id:1092364231 --> @ac1982 commented on GitHub (Apr 8, 2022): same problem here in windows 11 arm64 on Surface Pro X. ScreentoGif was installed from Microsoft store. [Logs.zip](https://github.com/NickeManarin/ScreenToGif/files/8447880/Logs.zip)
Author
Owner

@NickeManarin commented on GitHub (Apr 13, 2022):

There's one library that has a non arm64 architecture which is triggering this error.
Unfortunately, the error message doesn't say which one. It appears to be framework related, but it could be one from the app itself.

Can you try checking if any error message pops up in the event viewer?
Win + X > Event Viewer > Windows Logs > Applications.

Any .NET related errors. Thank you.

<!-- gh-comment-id:1097490925 --> @NickeManarin commented on GitHub (Apr 13, 2022): There's one library that has a non arm64 architecture which is triggering this error. Unfortunately, the error message doesn't say which one. It appears to be framework related, but it could be one from the app itself. Can you try checking if any error message pops up in the event viewer? Win + X > Event Viewer > Windows Logs > Applications. Any .NET related errors. Thank you.
Author
Owner

@ac1982 commented on GitHub (Apr 14, 2022):

There's one library that has a non arm64 architecture which is triggering this error. Unfortunately, the error message doesn't say which one. It appears to be framework related, but it could be one from the app itself.

Can you try checking if any error message pops up in the event viewer? Win + X > Event Viewer > Windows Logs > Applications.

Any .NET related errors. Thank you.

I tried your way, but neither of dotnet events were found in Win + X > Event Viewer > Windows Logs > Applications. A Security-SPP event was logged when starting SreenToGif.

日志名称:          Application
来源:            Microsoft-Windows-Security-SPP
日期:            2022/4/14 10:17:45
事件 ID:         16394
任务类别:          无
级别:            信息
关键字:           经典
用户:            暂缺
计算机:           S2n7X
描述:
脱机下级迁移成功。
事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-SPP" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" EventSourceName="Software Protection Platform Service" />
    <EventID Qualifiers="49152">16394</EventID>
    <Version>0</Version>
    <Level>4</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2022-04-14T02:17:45.3799095Z" />
    <EventRecordID>69976</EventRecordID>
    <Correlation />
    <Execution ProcessID="6968" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>MyComputer</Computer>
    <Security />
  </System>
  <EventData>
  </EventData>
</Event>

And with the ScreenToGif log here.
22_04_14.zip

<!-- gh-comment-id:1098648399 --> @ac1982 commented on GitHub (Apr 14, 2022): > There's one library that has a non arm64 architecture which is triggering this error. Unfortunately, the error message doesn't say which one. It appears to be framework related, but it could be one from the app itself. > > Can you try checking if any error message pops up in the event viewer? Win + X > Event Viewer > Windows Logs > Applications. > > Any .NET related errors. Thank you. I tried your way, but neither of dotnet events were found in Win + X > Event Viewer > Windows Logs > Applications. A Security-SPP event was logged when starting SreenToGif. ``` 日志名称: Application 来源: Microsoft-Windows-Security-SPP 日期: 2022/4/14 10:17:45 事件 ID: 16394 任务类别: 无 级别: 信息 关键字: 经典 用户: 暂缺 计算机: S2n7X 描述: 脱机下级迁移成功。 事件 Xml: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Microsoft-Windows-Security-SPP" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" EventSourceName="Software Protection Platform Service" /> <EventID Qualifiers="49152">16394</EventID> <Version>0</Version> <Level>4</Level> <Task>0</Task> <Opcode>0</Opcode> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2022-04-14T02:17:45.3799095Z" /> <EventRecordID>69976</EventRecordID> <Correlation /> <Execution ProcessID="6968" ThreadID="0" /> <Channel>Application</Channel> <Computer>MyComputer</Computer> <Security /> </System> <EventData> </EventData> </Event> ``` And with the ScreenToGif log here. [22_04_14.zip](https://github.com/NickeManarin/ScreenToGif/files/8485802/22_04_14.zip)
Author
Owner

@NickeManarin commented on GitHub (Apr 30, 2022):

With .NET 7, the app loads normally.
I'm going to publish the arm64 variant using NET7 Preview 3 for now.

<!-- gh-comment-id:1114059298 --> @NickeManarin commented on GitHub (Apr 30, 2022): With .NET 7, the app loads normally. I'm going to publish the arm64 variant using NET7 Preview 3 for now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#821
No description provided.