无法加载文件或程序集“System.Web.DataVisualization”或其某个依赖项

4
我收到了这个错误:
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.

在收到这个错误后,我将 system.web.DataVisualization.dll 的属性更改为 Copy Local=true,并且这个 dll 也在 bin 目录中。但是错误仍然存在。

我应该怎么做才能摆脱这个错误。


你的 .NET 版本是什么? - user1659922
3个回答

2

将web.config文件中的System.Web.DataVisualization版本更改为项目框架版本。

例如:

System.Web.DataVisualization, Version=4.0.0.0

to

System.Web.DataVisualization, Version=3.5.0.0

请确保更改所有等效项。


1
您可能需要检查一下您的项目是否使用了比较新的.Net版本(4.0或更高版本)。
请在项目的属性下查看目标框架:

Project properties


0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接