Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while creating languages combobox #2685

Closed
ameshkov opened this issue May 29, 2019 · 2 comments

Comments

@ameshkov
Copy link
Member

commented May 29, 2019

WARNING, Adguard, 17, 29.05.2019 22:16:16.654, Error while processing task: System.InvalidCastException: Не удалось привести тип объекта "System.String" к типу "System.Globalization.CultureInfo".
Source: Adguard
Stack trace:    в Adguard.View.Settings.Blocks.GeneralSettingsBlockView.h57ISumuE7(Object  , DependencyPropertyChangedEventArgs  )
   в System.Windows.FrameworkElement.RaiseDependencyPropertyChanged(EventPrivateKey key, DependencyPropertyChangedEventArgs args)
   в System.Windows.FrameworkElement.OnDataContextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.Controls.TextBlock.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   в System.Windows.TreeWalkHelper.OnInheritablePropertyChanged(DependencyObject d, InheritablePropertyChangeInfo info, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
   в System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
   в System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
   в System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   в System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
   в System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
   в System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
   в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   в System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   в System.Windows.Controls.ContentPresenter.OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   в System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   в System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, FrugalStructList`1& dependents, Boolean invalidateOnlyContainer)
   в System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, Boolean invalidateOnlyContainer, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalMap& propertyTriggersWithActions, Int32 sourceChildIndex)
   в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   в System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   в System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)
   в System.Windows.Controls.ComboBox.UpdateSelectionBoxItem()
   в System.Windows.Controls.ComboBox.SelectedItemUpdated()
   в System.Windows.Controls.ComboBox.OnSelectionChanged(SelectionChangedEventArgs e)
   в System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List`1 unselectedInfos, List`1 selectedInfos)
   в System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
   в System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
   в System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   в System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   в System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   в Adguard.View.Settings.Blocks.GeneralSettingsBlockView.<>c__DisplayClass3.UEBdL9TEuxssPuumxeky(Object , Int32 )
   в Adguard.View.Settings.Blocks.GeneralSettingsBlockView.<>c__DisplayClass3.<LanguageComboBox_OnSelectionChanged>b__1()
   в System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
   в System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   в System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   в System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   в System.Windows.Threading.Dispatcher.Invoke(Action callback)
   в Adguard.UI.WpfUtils.nP8VIcG2cHsNwuHthaa(Object , Object )
   в Adguard.UI.WpfUtils.RunOnUiThread(Action actionToRun, Boolean isAsync, Boolean forceDispatcherInvoke)
   в Adguard.View.Settings.Blocks.GeneralSettingsBlockView.<>c__DisplayClass3.<LanguageComboBox_OnSelectionChanged>b__0()
   в Adguard.Commons.Threading.FastThreadPoolWorker.ProcessTask()
@ameshkov ameshkov added this to the 7.0 milestone May 29, 2019
@ameshkov

This comment has been minimized.

Copy link
Member Author

commented May 29, 2019

Also, here's what I see in the log when I change language:

INFO, Adguard, 1, 29.05.2019 22:14:04.917, Set selected language to: en.
INFO, Adguard, 1, 29.05.2019 22:14:04.918, Change application language to en
WARNING, Adguard, 1, 29.05.2019 22:14:04.923, Error writing to the file C:\ProgramData\Adguard\locale.dat: System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\Adguard\locale.dat' is denied.
Source: mscorlib
Stack trace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
   at System.IO.File.WriteAllText(String path, String contents)
   at Adguard.Commons.Files.FileUtils.WriteQuietly(String path, String text)
@ameshkov ameshkov modified the milestones: 7.0, 7.1 May 29, 2019
@northis

This comment has been minimized.

Copy link
Member

commented Jun 7, 2019

Resolved in adguard-windows/pull-requests/506.
It is impossible to reproduce, so we just have to wait until this fix will be confirmed by user.

@zzebrum zzebrum closed this Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.