After moving from actipro version 19.1.687 to 22.1.1 a new maybe native exception appears

Editors for WPF Forum

Posted 6 months ago by Daniel Constantin - ModuleWorks GmbH
Version: 22.1.1
Avatar

Hi,

After moving from wpf version 19.1.687 to 22.1.1 a new, maybe native, exception appears.

On my application I use in Visual Studio “debug” solution configuration and “Enable native code debugging”. Inside the Visual Studio “Exception Settings” window I have selected to break to all the exceptions. In this application I use only the “ActiproSoftware.Editors.Wpf”, “ActiproSoftware.Ribbon.Wpf” and “ActiproSoftware.Ribbon.Wpf” NuGet packages.

The call stack is very ugly and I cannot pin point from where the problem. It might be from the “ActiproSoftware.Editors.Wpf” assembly.

Call stack:

KernelBase.dll!RaiseException()
vcruntime140_clr0400.dll!00007ffa702f44f2()
mscorlib.ni.dll!00007ffa34d55da7()
[Managed to Native Transition]
mscorlib.dll!System.Reflection.RuntimeAssembly.GetType(string name, bool throwOnError, bool ignoreCase)
PresentationFramework.dll!System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(System.Windows.Baml2006.Baml2006SchemaContext.BamlType bamlType)
PresentationFramework.dll!System.Windows.Baml2006.Baml2006SchemaContext.GetClrType(short typeId)
PresentationFramework.dll!System.Windows.Baml2006.Baml2006Reader.Process_DefAttributeKeyType()
PresentationFramework.dll!System.Windows.Baml2006.Baml2006Reader.ReadKeys()
PresentationFramework.dll!System.Windows.ResourceDictionary.SetDeferrableContent(System.Windows.DeferrableContent deferrableContent)
PresentationFramework.dll!System.Windows.Baml2006.WpfSharedBamlSchemaContext.Create_BamlProperty_ResourceDictionary_DeferrableContent.AnonymousMethod__297_0(object target, object value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property, object value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(object obj, System.Xaml.XamlMember property, object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx, System.Xaml.XamlMember prop, object value, bool onParent)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()
System.Xaml.dll!System.Xaml.XamlServices.Transform(System.Xaml.XamlReader xamlReader, System.Xaml.XamlWriter xamlWriter, bool closeWriter)
PresentationFramework.dll!System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(System.Reflection.Assembly assembly, string assemblyName, string resourceName, bool isTraceEnabled, out System.Uri dictionarySourceUri)
PresentationFramework.dll!System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(bool isTraceEnabled)
PresentationFramework.dll!System.Windows.SystemResources.FindDictionaryResource(object key, System.Type typeKey, System.Windows.ResourceKey resourceKey, bool isTraceEnabled, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference, out bool canCache)
PresentationFramework.dll!System.Windows.SystemResources.FindResourceInternal(object key, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference)
PresentationFramework.dll!System.Windows.FrameworkElement.FindResourceInternal(System.Windows.FrameworkElement fe, System.Windows.FrameworkContentElement fce, System.Windows.DependencyProperty dp, object resourceKey, object unlinkedParent, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference, System.Windows.DependencyObject boundaryElement, bool isImplicitStyleLookup, out object source)
PresentationFramework.dll!System.Windows.StaticResourceExtension.FindResourceInAppOrSystem(System.IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
PresentationFramework.dll!System.Windows.StaticResourceExtension.FindResourceInEnviroment(System.IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
PresentationFramework.dll!System.Windows.StaticResourceExtension.TryProvideValueImpl(System.IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
PresentationFramework.dll!System.Windows.ResourceDictionary.SetOptimizedStaticResources(System.Collections.Generic.IList<object> staticResources, System.IServiceProvider serviceProvider, System.Windows.StaticResourceExtension staticResourceWorker)
PresentationFramework.dll!System.Windows.ResourceDictionary.SetKeys(System.Collections.Generic.IList<System.Windows.Baml2006.KeyRecord> keyCollection, System.IServiceProvider serviceProvider)
PresentationFramework.dll!System.Windows.Baml2006.WpfSharedBamlSchemaContext.Create_BamlProperty_ResourceDictionary_DeferrableContent.AnonymousMethod__297_0(object target, object value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property, object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx, System.Xaml.XamlMember prop, object value, bool onParent)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader, System.Xaml.XamlObjectWriter xamlWriter, bool onlyLoadOneNode, bool skipJournaledProperties, bool shouldPassLineNumberInfo, System.Xaml.IXamlLineInfo xamlLineInfo, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack, System.Windows.Markup.IStyleConnector styleConnector)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)
PresentationFramework.dll!System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream stream, System.Windows.Markup.ParserContext pc)
PresentationFramework.dll!MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(System.IO.Stream stream, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(System.IO.Stream s, MS.Internal.ContentType contentType, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!System.Windows.ResourceDictionary.Source.set(System.Uri value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property, object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx, System.Xaml.XamlMember prop, object value, bool onParent)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader, System.Xaml.XamlObjectWriter xamlWriter, bool onlyLoadOneNode, bool skipJournaledProperties, bool shouldPassLineNumberInfo, System.Xaml.IXamlLineInfo xamlLineInfo, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack, System.Windows.Markup.IStyleConnector styleConnector)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)
PresentationFramework.dll!System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream stream, System.Windows.Markup.ParserContext pc)
PresentationFramework.dll!MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(System.IO.Stream stream, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(System.IO.Stream s, MS.Internal.ContentType contentType, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!System.Windows.ResourceDictionary.Source.set(System.Uri value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property, object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx, System.Xaml.XamlMember prop, object value, bool onParent)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader, System.Xaml.XamlObjectWriter xamlWriter, bool onlyLoadOneNode, bool skipJournaledProperties, bool shouldPassLineNumberInfo, System.Xaml.IXamlLineInfo xamlLineInfo, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack, System.Windows.Markup.IStyleConnector styleConnector)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)
PresentationFramework.dll!System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream stream, System.Windows.Markup.ParserContext pc)
PresentationFramework.dll!MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(System.IO.Stream stream, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(System.IO.Stream s, MS.Internal.ContentType contentType, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!System.Windows.ResourceDictionary.Source.set(System.Uri value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property, object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx, System.Xaml.XamlMember prop, object value, bool onParent)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader, System.Xaml.XamlObjectWriter xamlWriter, bool onlyLoadOneNode, bool skipJournaledProperties, bool shouldPassLineNumberInfo, System.Xaml.IXamlLineInfo xamlLineInfo, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack, System.Windows.Markup.IStyleConnector styleConnector)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)
PresentationFramework.dll!System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream stream, System.Windows.Markup.ParserContext pc)
PresentationFramework.dll!MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(System.IO.Stream stream, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(System.IO.Stream s, MS.Internal.ContentType contentType, System.Uri baseUri, bool canUseTopLevelBrowser, bool sandboxExternalContent, bool allowAsync, bool isJournalNavigation, out System.Windows.Markup.XamlReader asyncObjectConverter)
PresentationFramework.dll!System.Windows.ResourceDictionary.Source.set(System.Uri value)
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property, object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx, System.Xaml.XamlMember prop, object value, bool onParent)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader, System.Xaml.XamlObjectWriter xamlWriter, bool onlyLoadOneNode, bool skipJournaledProperties, bool shouldPassLineNumberInfo, System.Xaml.IXamlLineInfo xamlLineInfo, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack, System.Windows.Markup.IStyleConnector styleConnector)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri)
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)
Test.Views.Main.InitializeComponent() Line 1

Kind regards,

Daniel

Comments (7)

Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Since our controls aren't part of the stack trace, it's hard to say what might be causing this. Are you able to comment out controls in the XAML that is being loaded to see which controls, when excluded, stop the exception from being thrown?

If you can reproduce this in a small sample application and send to our support address, we might be able to debug locally and get a better idea if one of our controls is the cause.


Actipro Software Support

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi,

The problem was on my side it seems. I changed the templates for some editors and it seems that from there I have the exception.

Thanks,

Daniel

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi,

It seems that somehow for editors when I start the application it throws the exception when trying to set this DefaultStyleKey:

base.DefaultStyleKey = typeof(Int16EditBox);

Somehow it will not find the resource.

Kind regardsm

Daniel

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Somehow in PresentationFramerowk it cannot resolve baml to type for the types from Editors.

Answer - Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Daniel,

We aren't aware of anything like that and haven't seen it happen in our samples.  The only time we've really seen that kind of exception where it can't find a resource is when you have conflicting versions of an assembly loaded in the same AppDomain.

Your original post mentioned you use the “ActiproSoftware.Editors.Wpf”, “ActiproSoftware.Ribbon.Wpf” and “ActiproSoftware.Ribbon.Wpf” NuGet packages.  I suspect the last one was a typo.  

Can you clarify which packages you use, and can you reproduce this in a new simple sample project?  If so, please email our support address with the project so we can debug with it and see what's going on.  Be sure to exclude the bin/obj folders from the .zip you send so it doesn't get spam blocked.

You should be able to reference multiple Actipro NuGet packages as long as you are sure ALL of the NuGet package references in all projects of your solution target the same version.  If one of those packages is targeting a different version than another, then that is a scenario where you'd be possibly loading two versions of the Editors assembly and that could lead to the exception you see.


Actipro Software Support

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

It was a typo. I am using "ActiproSoftware.Controls.WPF.Shared", "ActiproSoftware.Controls.WPF.Ribbon" and "ActiproSoftware.Controls.WPF.Editors". The thing is that I could not replicate this with a small project. My sln has like 13 projects from which  like 8 are using these packages.

I will check if all the projects are using 22.1.1 version.

Thanks for the suggestion

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi,

It seems I referenced different version of packages inside one project from which this exception appeared. Now when all the packages have the same version I do not have it anymore.

Thanks!

The latest build of this product (v22.1.3) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.