I'm trying to use the Chart control in asp.net 4.0. While I know it required a separate install as part of 3.5, it's included by default with 4.0.
I can see the Chart control in my toolbox, and I can drag it to my designer and see a preview of the chart. However, when I try to compile my website, I get an error stating:
The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)
I receive the same error when I take a brand new page and add the following:
using System.Web.UI.DataVisualization;
Any ideas? I can understand why I would get this error in 3.5, but no clue why I would receive in 4.0, especially when I can see the control in the toolbox.
Click on Add References in your project and Browse to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
and add the System.Web.DataVisualization dll
file.
Before adding the dll remove the previous one and make sure that change the Target Frameweok to V4.0 in the project properties.
This will solve your problem.
Click on Add References in your project and in the .NET Components tab add the System.Web.DataVisualization. This should solve your problem.
When I upgraded my website from .net 3.5 to 4.0, some of the references in my web.config didn't automatically get updated to 4.0. After I manually updated them, everything worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With