We are converting existing projects with Infragistics WPF 12.2 assembly references to .NET4.5.
I cannot get VS2012 or Blend CTP 2 Update 2 to display any IG controls in the designer after changing to .NET 4.5. Projects build and run correctly.
Designer shows errors similar to:
"Object of type Jnfragistics.Windows.Themes.RibbonGeneric+ Locator cannot be converted to type Infragistics.Windows.Themes.ResourceSetLocator."
Virtually every IG control will display this error in the designer where the theme assembly is specific to the control type throwing the error.
Our Infragistics dlls are from the CLR4.0 folder. I see there is also a "Version Free" folder. Do I need to change my references to the "Version Free" dlls?
I have confirmed that all projects in the solution are targeting .NET 4.5 and they all build and run correctly. I just can't get the WYSIWYG designer to show Infragistics controls.
I used the same technique to attach to Blend and got the same stack as posted earlier with this exception also being thrown once for each TabItem in the RibbonTabs collection:
System.ArgumentException occurred HResult=-2147024809 Message=The value "Microsoft.Expression.Platform.InstanceBuilders.FallbackControl" is not of type "Infragistics.Windows.Ribbon.RibbonTabItem" and cannot be used in this generic collection.Parameter name: value Source=mscorlib ParamName=value StackTrace: at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) InnerException:
I tried the technique described in Alan's link, attaching a second instance of VS to the project instance. I did not get any additional trace information. This exception was thrown several dozen times as VS tried to render the view in the designer:
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
There were no additional details in the exception.
Thanks Andrew and Alan,
A also have been suspecting that so I am going through and reconfirming all the project references are to the same Infragistics dlls and are built on those and that any projects dlls are rebuilt with those references and that the project platforms are consistent across all projects. Alan, I will try to get the call stack using the technique you describe in the link next week.
Debug Modules window shows only Infragistics version-free assemblies loaded. Also, this is a design time error. Runtime, everything seems fine. I am just focused on getting the VS and Blend designers working... so I can get back to building the app :)
From the VS2012 Designer, here is the full stack trace:
Exception: Cannot create an instance of "XamRibbon".
at Microsoft.Expression.Platform.InstanceBuilders.InstanceBuilderOperations.InstantiateType(Type type, Boolean supportInternal)
at Microsoft.Expression.Platform.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateTargetType(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.Platform.InstanceBuilders.ClrObjectInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.WpfPlatform.InstanceBuilders.FrameworkElementInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.Platform.InstanceBuilders.ViewNodeManager.CreateInstance(IInstanceBuilder builder, ViewNode viewNode)
TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
XamlObjectWriterException: Set property 'Infragistics.Windows.Themes.ResourceSetLoader.Locator' threw an exception.
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteEndMember()
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter)
at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
at System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(Boolean isTraceEnabled)
at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
at System.Windows.FrameworkElement.FindResourceInternal(FrameworkElement fe, FrameworkContentElement fce, DependencyProperty dp, Object resourceKey, Object unlinkedParent, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, DependencyObject boundaryElement, Boolean isImplicitStyleLookup, Object& source)
at System.Windows.ResourceReferenceExpression.GetRawValue(DependencyObject d, Object& source, DependencyProperty dp)
at System.Windows.ResourceReferenceExpression.GetValue(DependencyObject d, DependencyProperty dp)
at System.Windows.DependencyObject.EvaluateBLOCKED EXPRESSION
It would also help to get a list of what is in the Debug->Windows->Modules. Almost sounds like multiple instances of one or more Infragistics assemblies or perhaps mismatched versions are loaded into memory.
Hello,
Is there a call stack included with the exception? If not maybe you could follow steps similar to what I posted here to get one.
Let me know if you have any questions with this matter.