我已将Web应用程序从.NET 3.5升级到.NET 4,并且在浏览到使用Chart控件的页面时出现此异常: The type ‘System.Web.UI.DataVisualization.Charting.Grid’ exists in both ‘c:\Windows\Microsoft.NET\assembly\GAC_MSIL\S
The type ‘System.Web.UI.DataVisualization.Charting.Grid’ exists in both ‘c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.DataVisualization\v4.0_4.0.0.0__…\System.Web.DataVisualization.dll’ and ‘c:\Windows\assembly\GAC_MSIL\System.Web.DataVisualization\3.5.0.0__…\System.Web.DataVisualization.dll’
如何使用4.0控件实现此功能?谢谢.
你可以使用 assembly redirection.例如(确保publicKeyToken是正确的,我在这台计算机上没有程序集):
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.DataVisualization" publicKeyToken="32ab4ba45e0a69a1" culture="neutral" /> <bindingRedirect oldVersion="3.5.0.0" newVersion="4.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>