System.Web.UI.DataVisualization.Charting.Grid exists twice in the GAC

I upgraded the web application from .NET 3.5 to .NET 4, and I get this exception when viewing a page using the Chart control:

The type "System.Web.UI.DataVisualization.Charting.Grid" exists as in "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 '

How can I get this working using the 4.0 control? Thank.

+3
source share
3 answers

You can use 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>
+3

1) , 3.5 Chart web.config, 4:

tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" ... Version=4.0.0.0 ...

add path="ChartImg.axd" verb="GET,HEAD,POST" ... Version=4.0.0.0 ...

add name="ChartImageHandler" ... Version=4.0.0.0 ...

2) Bin, .NET 4

+4

Delete one of them, one of them is in the GAC, and one is in your project I guees.

Perhaps you have a link in your project that is left after using .NET 3.5? Or other DLL files that use it: =)

0
source

Source: https://habr.com/ru/post/1796154/


All Articles