Enabling XAML design view in Visual Studio 2008


A user with Visual Studio 2008 and the June 2009 WPF Toolkit installed would be happily using the Data Visualization assembly (Charting) in their projects and everything would be working fine for weeks on end. Then one day they'd install Blend 3 and all of a sudden Visual Studio 2008 would fail trying to open the Charting project with a confusing "Problem Loading" error from the design surface:
'/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.
The first thing most people would try is uninstalling Blend 3 - which fortunately "fixes" the problem - but makes for a crummy long-term solution...
Fortunately, we managed to get the right people from the Silverlight Toolkit, Blend 3, and Visual Studio 2008 teams in a room a few days ago to hash this out. The first bit of good news is that we did sort out enough of what's going on to come up with an easy workaround. The second bit of good news is that I've already made a change to the WPF Toolkit source code so the next official release won't trigger this problem. And the third bit of good news is that they're going to make sure the underlying issue is addressed in Visual Studio 2010 so this doesn't come up again!
Here's the official synopsis of the problem and the steps to implement the simple workaround:
Known Issue with WPF Toolkit June 2009, Visual Studio 2008, and Blend 3
If a customer has Visual Studio 2008, WPF Toolkit June 2009, and Blend 3 installed, and the WPF project in Visual Studio 2008 has a reference to System.Windows.Controls.DataVisualization.Toolkit.dll, you may see the following error message when opening the project or loading the designer:
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'.
The problem can be triggered by dragging the Chart control from WPF Toolkit June 2009 from the Toolbox onto the WPF designer in Visual Studio.
To resolve this issue, use the following workaround:
From an account with elevated/administrative permissions, in the WPF Toolkit June 2009 install directory on the machine (typically "C:\Program Files\WPF Toolkit\v3.5.40619.1"):
  1. Rename System.Windows.Controls.DataVisualization.Toolkit.Design.dll to System.Windows.Controls.DataVisualization.Toolkit.Design.4.0.dll
  2. Rename System.Windows.Controls.DataVisualization.Toolkit.Design.pdb to System.Windows.Controls.DataVisualization.Toolkit.Design.4.0.pdb
Thank you for everyone's patience as we sorted this out. I wish we could have done so sooner, but I'm really glad we seem to have gotten to the bottom of it at last!

PS - If you still have problems after applying the fix, please let me know!

3 comments:

deepak said...

very nice tutorial. this is exactly what i was looking for. thanks a ton :)

Epicsystems said...

Dear Sir,

I have the pleasure to brief on our Data Visualization software
"Trend Compass".

TC is a new concept in viewing statistics and trends in an animated
way by displaying 5 axis (X, Y, Time, Bubble size & Bubble color)
instead of just the traditional X and Y axis. It could be used in
analysis, research, presentation etc. In the banking sector, we have
Deutsche Bank New York as our client.


This a link on weather data :

http://www.epicsyst.com/test/v2/aims/

This is a bank link to compare Deposits, Withdrawals and numbers of
Customers for different branches over time ( all in 1 Chart) :

http://www.epicsyst.com/test/v2/bank-trx/

Misc Examples :

http://www.epicsyst.com/test/v2/airline/
http://www.epicsyst.com/test/v2/stockmarket1/
http://www.epicsyst.com/test/v2/tax/
http://www.epicsyst.com/test/v2/football/
http://www.epicsyst.com/test/v2/swinefludaily/
http://www.epicsyst.com/test/v2/flu/
http://www.epicsyst.com/test/v2/babyboomers/
http://www.epicsyst.com/test/v2/bank-trx/
http://www.epicsyst.com/test/v2/advertising/

This is a project we did with Princeton University on US unemployment :
http://www.epicsyst.com/main3.swf

A 3 minutes video presentation of above by Professor Alan Krueger
Bendheim Professor of Economics and Public Affairs at Princeton
University and currently Chief Economist at the US Treasury using
Trend Compass :
http://epicsyst.com/trendcompass/princeton.aspx?home=1

Latest financial links on the Central Bank of Egypt:

http://www.epicsyst.com/trendcompass/samples/Aggregate-balance-sheet/
http://www.epicsyst.com/trendcompass/samples/balance-sheet
http://www.epicsyst.com/trendcompass/samples/banks-deposits-by-maturity/
http://www.epicsyst.com/trendcompass/samples/egyptian-banks/
http://www.epicsyst.com/trendcompass/samples/currency-by-denomination/

I hope you could evaluate it and give me your comments. So many ideas
are there.

You can download a trial version. It has a feature to export
EXE,PPS,HTML and AVI files. The most impressive is the AVI since you
can record Audio/Video for the charts you create.

http://epicsyst.com/trendcompass/FreeVersion/TrendCompassv1.2_DotNet.zip

All the best.


Epic Systems
www.epicsyst.com

Adam said...

I actually uninstalled the toolkit, am not using DataVisualization and it is not referenced), did a devenv /resetsettings and am still getting the error. I checked again and had Telerik.Windows.Controls.DataVisualization - removed it, recompiled, and it works.

Blend is installed.

Post a Comment