I have a problem with XamDataChart in a WPF application. When I add the chart to the page the designer works ok, I set everything up and it looks ok on screen. Then I start the application and the chart constructor crashes the app looking for a non-existent assembly. This happens in both debug and release builds.

System.IO.FileNotFoundException occurred
Message=Could not load file or assembly 'InfragisticsWPF4.DataVisualization.v11.1.Aero, Version=11.1.20111.2094, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its dependencies. The system cannot find the file specified.
...
Calling assembly : PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.

Callstack (relevant parts):

mscorlib.dll!System.Reflection.RuntimeAssembly.InternalLoadAssemblyName
mscorlib.dll!System.Reflection.RuntimeAssembly.InternalLoad
mscorlib.dll!System.Reflection.Assembly.Load
PresentationFramework.dll!System.Windows.SystemResources.ResourceDictionaries.LoadExternalAssembly
... 
InfragisticsWPF4.DataVisualization.v11.1.dll!Infragistics.InteractiveControl.InteractiveControl()   InfragisticsWPF4.DataVisualization.v11.1.dll!Infragistics.Controls.XamZoombar.XamZoombar()
InfragisticsWPF4.Controls.Charts.XamDataChart.v11.1.dll!Infragistics.Controls.Charts.XamDataChart.XamDataChart()
System.Xaml.dll!System.Xaml.Schema.XamlTypeInvoker.CreateInstance

Since I doubt that Infragistics ships their assemblies with unresolved references and I could not find the .Aero assembly anywhere on HDD I imagine this is some dynamic assembly loading done by PresentationFramework "on behalf" of control's assembly. I'm still not that good in WPF and I do not really understand this mechanism nor why the WPF tries to load this assembly nor why is it so important that WPF cannot fail gracefully. Can someone please shed some light on this and help me resolve this impasse.

有帮助吗?

解决方案

I believe, since your application is a WPF one and it tries to integrate with current theme in windows or current theme of your application, it searches for this .Aero dll since you are using Aero theme. You need to locate this dll and add the your project or changing your theme may be a workaround.

其他提示

For me the answer was to delete my .suo file and ReBuild my entire solution. As suggested by one of the answers to this question.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top