[GH-ISSUE #388] Newer versions crash - NotifyIcon.IconSource exception #1689

Closed
opened 2026-03-01 18:47:30 +03:00 by kerem · 6 comments
Owner

Originally created by @mrfearless on GitHub (Oct 16, 2018).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/388

Originally assigned to: @NickeManarin on GitHub.

I can only install ScreenToGif 2.12.1 - any newer versions seems to crash on launching.

Set property 'ScreenToGif.Controls.NotifyIcon.IconSource' threw an exception.

I have uninstalled and installed afresh each version after ScreenToGif 2.12.1 to test, and this is the last version that will work, all the newer versions crash the same way. Im using windows 7 x64.

Originally created by @mrfearless on GitHub (Oct 16, 2018). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/388 Originally assigned to: @NickeManarin on GitHub. I can only install ScreenToGif 2.12.1 - any newer versions seems to crash on launching. ```Set property 'ScreenToGif.Controls.NotifyIcon.IconSource' threw an exception.``` I have uninstalled and installed afresh each version after ScreenToGif 2.12.1 to test, and this is the last version that will work, all the newer versions crash the same way. Im using windows 7 x64.
kerem 2026-03-01 18:47:30 +03:00
Author
Owner

@NickeManarin commented on GitHub (Oct 20, 2018):

Can you provide the entire stack trace?

<!-- gh-comment-id:431586682 --> @NickeManarin commented on GitHub (Oct 20, 2018): Can you provide the entire stack trace?
Author
Owner

@mrfearless commented on GitHub (Oct 20, 2018):

► Title - 
	On Dispacher Unhandled Exception - Unknown
▬ Message - 
	Set property 'ScreenToGif.Controls.NotifyIcon.IconSource' threw an exception.
○ Type - 
	System.Windows.Markup.XamlParseException
♦ [Version] Date/Hour - 
	[2.13.3] 10/16/2018 10:55:46
▲ 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.ResourceDictionary.CreateObject(KeyRecord key)
   at System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   at System.Windows.Application.FindResource(Object resourceKey)
   at ScreenToGif.App.Application_Startup(Object sender, StartupEventArgs e)
   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)

▬▬ Message - 
	The operation completed successfully
○○ Type - 
	System.ComponentModel.Win32Exception
▲▲ Source - 
	System.Drawing
▼▼ TargetSite - 
	Void Initialize(Int32, Int32)
♠♠ StackTrace - 
   at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
   at ScreenToGif.ImageUtil.ImageMethods.ToIcon(ImageSource imageSource)
   at ScreenToGif.Controls.NotifyIcon.IconSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
<!-- gh-comment-id:431590534 --> @mrfearless commented on GitHub (Oct 20, 2018): ``` ► Title - On Dispacher Unhandled Exception - Unknown ▬ Message - Set property 'ScreenToGif.Controls.NotifyIcon.IconSource' threw an exception. ○ Type - System.Windows.Markup.XamlParseException ♦ [Version] Date/Hour - [2.13.3] 10/16/2018 10:55:46 ▲ 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.ResourceDictionary.CreateObject(KeyRecord key) at System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache) at System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache) at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache) at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache) at System.Windows.Application.FindResource(Object resourceKey) at ScreenToGif.App.Application_Startup(Object sender, StartupEventArgs e) 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) ▬▬ Message - The operation completed successfully ○○ Type - System.ComponentModel.Win32Exception ▲▲ Source - System.Drawing ▼▼ TargetSite - Void Initialize(Int32, Int32) ♠♠ StackTrace - at System.Drawing.Icon.Initialize(Int32 width, Int32 height) at ScreenToGif.ImageUtil.ImageMethods.ToIcon(ImageSource imageSource) at ScreenToGif.Controls.NotifyIcon.IconSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value) ```
Author
Owner

@mrfearless commented on GitHub (Jul 1, 2019):

I downloaded the source and commented out the section in github.com/NickeManarin/ScreenToGif@e7d7537435/ScreenToGif/App.xaml (L97) and recompiled.

I can get ScreenToGif to load now.

Although it does complain about a NotifyIcon missing, but it doesn't crash/hang now. Once it shows the exception box messages and after clicking ok ScreenToGif.exe is still loaded in memory and has to be killed via task manager or process explorer.

I could comment out those other NotifyIcon references, but just wanted to test this out.

Still no idea why it is causing this exception.

<!-- gh-comment-id:507236635 --> @mrfearless commented on GitHub (Jul 1, 2019): I downloaded the source and commented out the <!--Notification Icon--> section in https://github.com/NickeManarin/ScreenToGif/blob/e7d753743524c825ca741cb9d7d6960c3387ac8a/ScreenToGif/App.xaml#L97 and recompiled. I can get ScreenToGif to load now. Although it does complain about a NotifyIcon missing, but it doesn't crash/hang now. Once it shows the exception box messages and after clicking ok ScreenToGif.exe is still loaded in memory and has to be killed via task manager or process explorer. I could comment out those other NotifyIcon references, but just wanted to test this out. Still no idea why it is causing this exception.
Author
Owner

@NickeManarin commented on GitHub (Jul 8, 2019):

Are you up to date with your Windows 7 machine.
I had tested the version of ScreenToGif with the notification icon with Windows 7, but I don't have a machine/VM with Win7 anymore.

You can also opt-out from displaying a notification icon, edit the settings file or comment out the line of code that calls the exhibition of the icon from the App.xaml.cs file.

<!-- gh-comment-id:509207072 --> @NickeManarin commented on GitHub (Jul 8, 2019): Are you up to date with your Windows 7 machine. I had tested the version of ScreenToGif with the notification icon with Windows 7, but I don't have a machine/VM with Win7 anymore. You can also opt-out from displaying a notification icon, edit the settings file or comment out the line of code that calls the exhibition of the icon from the App.xaml.cs file.
Author
Owner

@mrfearless commented on GitHub (Jul 8, 2019):

Yes I keep my Win7 x64 up to date with latest security and rollups.

Ok I will look into doing that.

<!-- gh-comment-id:509209292 --> @mrfearless commented on GitHub (Jul 8, 2019): Yes I keep my Win7 x64 up to date with latest security and rollups. Ok I will look into doing that.
Author
Owner

@NickeManarin commented on GitHub (Nov 18, 2019):

I'm going to close this issue, to keep track using the other, which has more activity.

<!-- gh-comment-id:555021434 --> @NickeManarin commented on GitHub (Nov 18, 2019): I'm going to close this issue, to keep track using the other, which has more activity.
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#1689
No description provided.