c# - Freezable exception after logging in remotely and logging back locally -
i getting error reports users logging in remotely application. app works fine until when come office , log directly desktops - app crashes , error report standard 'freezable cannot frozen' none of known workarounds fixing one.
every single brush resource in app decorated ice:freeze:
<solidcolorbrush ice:freeze="true"
also exception thrown domain unhandled exception there way swallow it.
over last couple of months spent hours analyzing reported issues freezables bot cannot find solution.
.net code problem happens:
/// <summary> /// unbinds freezable context. /// </summary> /// <param name="resource">the resource freeze.</param> private static void freeze(object resource) { freezable freezable = resource freezable; if (freezable != null && !freezable.isfrozen) { freezable.freeze(); } } /// <summary> /// searches resource inside resourcedictionary. /// </summary> /// <param name="key">the original key.</param> /// <param name="typekey">the key cast type.</param> /// <param name="resourcekey">the key cast resourcekey.</param> /// <param name="istraceenabled">tracing on/off.</param> /// <param name="allowdeferredresourcereference"> /// if flag true resource not inflated baml. /// instead return instance of deferreddictionaryreference /// can later used query resource /// </param> /// <param name="mustreturndeferredresourcereference"> /// if method true method return /// deferredthemeresourcereference instance envelopes underlying resource. /// </param> /// <param name="cancache">whether callers can cache value.</param> /// <returns></returns> private static object finddictionaryresource( object key, type typekey, resourcekey resourcekey, bool istraceenabled, bool allowdeferredresourcereference, bool mustreturndeferredresourcereference, out bool cancache) { // thread safety handled findresourceinternal. sure have locked _resourcecache.syncroot. debug.assert(typekey != null || resourcekey != null, "typekey or resourcekey should non-null"); cancache = true; object resource = null; assembly assembly = (typekey != null) ? typekey.assembly : resourcekey.assembly; if ((assembly == null) || ignoreassembly(assembly)) { // without assembly, can't figure out dictionary at. // also, ignore common assemblies know not contain resources. return null; } resourcedictionaries dictionaries = ensuredictionaryslot(assembly); resourcedictionary dictionary = dictionaries.loadthemeddictionary(istraceenabled); if (dictionary != null) { resource = lookupresourceindictionary(dictionary, key, allowdeferredresourcereference, mustreturndeferredresourcereference, out cancache); } if (resource == null) { dictionary = dictionaries.loadgenericdictionary(istraceenabled); if (dictionary != null) { resource = lookupresourceindictionary(dictionary, key, allowdeferredresourcereference, mustreturndeferredresourcereference, out cancache); } } if (resource != null) { // resources coming out of dictionary may need frozen freeze(resource); } return resource; }
system.invalidoperationexception: freezable cannot frozen. @ system.windows.freezable.freeze() @ system.windows.systemresources.freeze(object resource) @ system.windows.systemresources.finddictionaryresource(object key, type typekey, resourcekey resourcekey, boolean istraceenabled, boolean allowdeferredresourcereference, boolean mustreturndeferredresourcereference, boolean& cancache) @ system.windows.systemresources.findresourceinternal(object key, boolean allowdeferredresourcereference, boolean mustreturndeferredresourcereference) @ system.windows.frameworkelement.findresourceinternal(frameworkelement fe, frameworkcontentelement fce, dependencyproperty dp, object resourcekey, object unlinkedparent, boolean allowdeferredresourcereference, boolean mustreturndeferredresourcereference, dependencyobject boundaryelement, boolean isimplicitstylelookup, object& source) @ system.windows.stylehelper.getchildvaluehelper(uncommonfield
1 datafield, itemstructlist
1& valuelookuplist, dependencyproperty dp, dependencyobject container, frameworkobject child, int32 childindex, boolean stylelookup, effectivevalueentry& entry, valuelookuptype& sourcetype, frameworkelementfactory templateroot) @ system.windows.stylehelper.getchildvalue(uncommonfield1 datafield, dependencyobject container, int32 childindex, frameworkobject child, dependencyproperty dp, frugalstructlist
1& childrecordfromchildindex, effectivevalueentry& entry, valuelookuptype& sourcetype, frameworkelementfactory templateroot) @ system.windows.stylehelper.getvaluefromtemplatedparent(dependencyobject container, int32 childindex, frameworkobject child, dependencyproperty dp, frugalstructlist1& childrecordfromchildindex, frameworkelementfactory templateroot, effectivevalueentry& entry) @ system.windows.frameworkelement.getvaluefromtemplatedparent(dependencyproperty dp, effectivevalueentry& entry) @ system.windows.frameworkelement.getrawvalue(dependencyproperty dp, propertymetadata metadata, effectivevalueentry& entry) @ system.windows.frameworkelement.evaluatebasevaluecore(dependencyproperty dp, propertymetadata metadata, effectivevalueentry& newentry) @ system.windows.dependencyobject.evaluateeffectivevalue(entryindex entryindex, dependencyproperty dp, propertymetadata metadata, effectivevalueentry oldentry, effectivevalueentry newentry, operationtype operationtype) @ 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) @ system.windows.stylehelper.invalidateresourcedependentsforchild(dependencyobject container, dependencyobject child, int32 childindex, resourceschangeinfo info, frameworktemplate parenttemplate) @ system.windows.treewalkhelper.invalidatestyleandreferences(dependencyobject d, resourceschangeinfo info, boolean containstypeofkey) @ system.windows.treewalkhelper.onresourceschanged(dependencyobject d, resourceschangeinfo info, boolean raiseresourcechangedevent) @ system.windows.treewalkhelper.onresourceschangedcallback(dependencyobject d, resourceschangeinfo info) @ system.windows.descendentswalker
1._visitnode(dependencyobject d) @ system.windows.descendentswalker1.visitnode(frameworkelement fe) @ system.windows.descendentswalker
1.visitnode(dependencyobject d) @ system.windows.descendentswalker1.walklogicalchildren(frameworkelement feparent, frameworkcontentelement fceparent, ienumerator logicalchildren) @ system.windows.descendentswalker
1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker
1._visitnode(dependencyobject d) @ system.windows.descendentswalker1.visitnode(frameworkelement fe) @ system.windows.descendentswalker
1.visitnode(dependencyobject d) @ system.windows.descendentswalker1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker
1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker1._visitnode(dependencyobject d) @ system.windows.descendentswalker
1.visitnode(frameworkelement fe) @ system.windows.descendentswalker1.visitnode(dependencyobject d) @ system.windows.descendentswalker
1.walklogicalchildren(frameworkelement feparent, frameworkcontentelement fceparent, ienumerator logicalchildren) @ system.windows.descendentswalker1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker
1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker1._visitnode(dependencyobject d) @ system.windows.descendentswalker
1.visitnode(frameworkelement fe) @ system.windows.descendentswalker1.visitnode(dependencyobject d) @ system.windows.descendentswalker
1.walklogicalchildren(frameworkelement feparent, frameworkcontentelement fceparent, ienumerator logicalchildren) @ system.windows.descendentswalker1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker
1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker1._visitnode(dependencyobject d) @ system.windows.descendentswalker
1.visitnode(frameworkelement fe) @ system.windows.descendentswalker1.visitnode(dependencyobject d) @ system.windows.descendentswalker
1.walklogicalchildren(frameworkelement feparent, frameworkcontentelement fceparent, ienumerator logicalchildren) @ system.windows.descendentswalker1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker
1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker1._visitnode(dependencyobject d) @ system.windows.descendentswalker
1.visitnode(frameworkelement fe) @ system.windows.descendentswalker1.visitnode(dependencyobject d) @ system.windows.descendentswalker
1.walklogicalchildren(frameworkelement feparent, frameworkcontentelement fceparent, ienumerator logicalchildren) @ system.windows.descendentswalker1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker
1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker1._visitnode(dependencyobject d) @ system.windows.descendentswalker
1.visitnode(frameworkelement fe) @ system.windows.descendentswalker1.visitnode(dependencyobject d) @ system.windows.descendentswalker
1.walklogicalchildren(frameworkelement feparent, frameworkcontentelement fceparent, ienumerator logicalchildren) @ system.windows.descendentswalker1.walkframeworkelementlogicalthenvisualchildren(frameworkelement feparent, boolean haslogicalchildren) @ system.windows.descendentswalker
1.iteratechildren(dependencyobject d) @ system.windows.descendentswalker`1.startwalk(dependencyobject startnode, boolean skipstartnode) @ system.windows.treewalkhelper.invalidateonresourceschange(frameworkelement fe, frameworkcontentelement fce, resourceschangeinfo info) @ system.windows.systemresources.invalidatetreeresources(object args) @ system.windows.threading.exceptionwrapper.internalrealcall(delegate callback, object args, int32 numargs) @ ms.internal.threading.exceptionfilterhelper.trycatchwhen(object source, delegate method, object args, int32 numargs, delegate catchhandler)
Comments
Post a Comment