DataVisualization.Toolkit reference breaks VS XAML Designer

Jul 23, 2009 at 3:47 PM

Hi,

Whenever I add a reference to System.Windows.Controls.DataVisualization.Toolkit to my VS2008 .NET3.5 project I then start getting the following error whenever I try to design a window. (I dont get it for a usercontrol, only a window?)

Error 1 '/Microsoft.Windows.Design.Developer;component/themes/GridAdorners.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Cannot create instance of 'GenericTheme' defined in assembly 'Microsoft.Windows.Design.Interaction, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been thrown by the target of an invocation.    Error at object 'ResourceDictionary_4'.

Especially weird because I dont even reference the charts within the xaml. Currently its only when I click a button that I dynamically create a chart object and add to the visual hierarchy.

I can reproduce with a stand alone app but dont see a place to upload it here.

I am using VS2008 with all the latest service packs for silverlight/wpf. I reference the datavisualization file from the GAC as it was installed by the msi. Visual studio has its path as c:\Program Files (x86)\WPF Toolkit\v3.5.40619.1\System.Windows.Controls.DataVisualization.Toolkit.dll

Any ideas?

Thanks,

Adam

 

Coordinator
Jul 23, 2009 at 6:02 PM

Adam,

I've never heard of this before... One quick idea: do you maybe not have .NET 3.5 *SP1* installed on that machine? The WPF Toolkit is compiled against SP1, so maybe the design stuff is mis-matching for you and causing this problem?

If you're still stuck, contact me via the "This Blog"/Email link on my blog (http://blogs.msdn.com/delay/) and give me your email address. I can reply and then you can send me the standalone app. Or just upload it to somewhere like Windows Live SkyDrive and post the URL here or send it to me via the contact link.

Thanks for your help!

Jul 23, 2009 at 6:12 PM

Hi,

The "work around" I found is Im actually using your build (thanks BTW :) ) of the datavisualization toolkit (http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx)

I prefer this anyhow because I can use the TreeMap in WPF.

thanks,

Adam

 

Aug 11, 2009 at 11:17 PM

I think I'm seeing something pretty similar. I've got WPF applications that I can see fine in the xaml editing view, however the one app I have right now that has charts isn't working at all in the designer. I'm seeing the same message as above:

 "Cannot create instance of 'GenericTheme' defined in assembly 'Microsoft.Windows.Design.Interaction, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been thrown by the target of an invocation."

I'm pretty sure everything here is up to date. Possibly x64 related (as I see the first poster is on a 64-bit O/S too)

-roger

Sep 16, 2009 at 9:35 PM

I'm having the same issue.  All the search results I get are not correct.  Started hitting me when I dragged/dropped a control from the toolbox onto my wpf form.

I deleted all the visualization toolbox items, then I shut down VS, moved the visualization dlls, and restarted VS.  Fixed the issue.

Dec 3, 2009 at 12:59 AM
williamjsullivan wrote:

I'm having the same issue.  All the search results I get are not correct.  Started hitting me when I dragged/dropped a control from the toolbox onto my wpf form.

I deleted all the visualization toolbox items, then I shut down VS, moved the visualization dlls, and restarted VS.  Fixed the issue.

This also worked for me because I was getting the same error ...

"Error    1    '/Microsoft.Windows.Design.Developer;component/themes/GridAdorners.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Cannot create instance of 'GenericTheme' defined in assembly 'Microsoft.Windows.Design.Interaction, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been thrown by the target of an invocation.    Error at object 'ResourceDictionary_4'.    D:\Visual Studio 2008\Projects\WOWTrax\WowTraxDesktop\Window1.xaml    6    5    WowTraxDesktop"

I right clicked and deleted the all the Data Visualization toolbox items, then shutdown visual studio. The edited my *.csproj project file and removed all data visualization references ...

<Reference Include="System.Windows.Controls.DataVisualization.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

...  except for the wpftoolkit reference that I kept ...

<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

I then opened my solution and re-added the reference to  System.Windows.Controls.DataVisualization.Toolkit

This worked for me.

Dec 10, 2009 at 2:20 PM

I too am having the same problem.  The up side is that this issue if forceing me to use Blend more.  I have not managed a workaroud that CONSISTENTLY allows VS to display the GUI design surface.  However, code editing and builds and runs work just fine, so I have Blend open doing design.  I save the XAML, ALT-TAB to VS do the code and hit F5 to test.  Not optimal, but it works.

This is Vista x64 Ultimate, VS 2008 with all known patches, Framework 3.5 SP1 with all known patches all of Expression 2.x and 3.x with all patches.  Not running VS as administrator.

Coordinator
Jan 20, 2010 at 4:28 AM

Hi all,

We believe we've gotten to the bottom of this issue at last. The next release of the WPF Toolkit shouldn't suffer from this problem and a simple workaround for the current release can be found here:

http://blogs.msdn.com/delay/archive/2010/01/19/sometimes-it-takes-a-village-to-solve-a-problem-workaround-for-a-visual-studio-2008-design-time-issue-with-the-wpf-toolkit-when-blend-3-is-installed.aspx

Hope this helps!