Oct 25, 2012

Weird .NET Framework 3.5 Problem - No reference to System.Windows.Forms.DataVisualization

I was recently in a SQL server 2008 performance tuning training, and installed SQL Server 2008 R2 and a bunch of related tools. And when I go back to work use Visual Studio 2010 to work on my Windows Form projects, I find that the project cannot be compiled.

There are more than 300 errors and warnings and this makes it very difficult to locate the real problem. After some analysis on the error messages, I was thinking the problem maybe caused by .NET framework. Because when installing 2008 R2 I remember that .NET framework was also installed. Some of the error message also helps to prove my suspect:

Warning The primary reference "******" could not be resolved because it has an indirect dependency on the framework assembly "System.Windows.Forms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "****" or retarget your application to a framework version which contains "System.Windows.Forms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

I was thinking to reinstall .NET framework 3.5 SP1 but before doing that, I suddenly found that in Microsoft website, there is a separate item called Microsoft Chart Controls for Microsoft .NET Framework 3.5. And I gave it a try first.


Then the problem is solved. 

Please download here: http://www.microsoft.com/en-us/download/details.aspx?id=14422

I don't know why SQL Server 2008 will remove the char controls, but this is the fix works for me. I checked many posts in the web but they didn't mention this, I write this done to offer some help.

If you think this post is helpful to you, please kindly click the adds on this page. Thanks a lot!

5 comments:

Anonymous said...

You are a life saver... 3 programmers spent 3 hours each to fix this issue...

thanks for your post..

Anonymous said...

Awesome.. It helped.... Thanks tonn

Anonymous said...

It worked!! Thanks a lot..

Anonymous said...

Solved the problem, thanks!

Anonymous said...

I just want to thank you for helping me fix an obscure error I was getting converting from vb2008 to vb2010 the primary reference "System.Windows.Forms.DataVisualization"