当前位置 : 主页 > 网络编程 > ASP >

asp.net – System.Web.UI.DataVisualization.Charting.Grid在GAC中存在两次

来源:互联网 收集:自由互联 发布时间:2021-06-24
我已将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
我已将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\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>
网友评论