Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'System.Web.DataVisualization' or one of its dependencies

Tags:

c#

asp.net

I received this error:

Server Error in Application.

Could not load file or assembly 'System.Web.DataVisualization' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'System.Web.DataVisualization' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.DataVisualization' could not be loaded.

After I received this error, I changed the property of system.web.DataVisualization.dll is Copy Local= true, and this dll is also in the bin directory. but the error remains constant.

What should I have to do to get rid of this error.

like image 483
user2189564 Avatar asked Oct 18 '25 17:10

user2189564


2 Answers

Change version of System.Web.DataVisualization in web.config file to project framework version.

Ex.

System.Web.DataVisualization, Version=4.0.0.0

to

System.Web.DataVisualization, Version=3.5.0.0

Make sure to change the all equivalents.

like image 83
Nishantha Avatar answered Oct 20 '25 08:10

Nishantha


You might want to check that your project is using a relatively recent version of .Net (4.0 or newer).

See Target Framework under properties for your project:

Project properties

like image 37
Kjartan Avatar answered Oct 20 '25 07:10

Kjartan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!