Dundas Data Visualization Support Site
Dundas Support Site Home  |  Contact Us  |  Dundas Home  
Contact Us via Email
Home

Fixing problems updating existing projects to newer versions of Dundas Chart using Binding Redirection

 

After upgrading Dundas Chart, you might see 'Found conflicts between different versions of the same dependent assembly' during compile time or an error like this at run time:

Could not load file or assembly 'DundasWinChart, Version=6.2.0.1740, Culture=neutral, PublicKeyToken=a4c03dce5db22406' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This error means you are running compiled assemblies that require different versions of the same Dundas product, or you are using two Dundas products that require different versions of the same Dundas product (for example, Dundas Chart for Windows Forms version 7 and Dundas OLAP Services for Windows Forms version 6.2).

One way to fix this issue is to add a binding redirection to force your application to use a version that you specify.

In Windows Forms, you will need to create a file called app.config in the application's root directory. This is an XML file and needs to supply these options:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DundasWinChart" publicKeyToken="a4c03dce5db22406" culture="neutral" />
        <bindingRedirect oldVersion="6.2.0.1740"
                         newVersion="7.0.0.1782" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

This tells the application to use version 7.0.0.1782 of the DundasWinChart assembly whenever it requires version 6.2.0.1740.

The configuration for ASP.NET application is the same, except that you will be putting the aboves tags into the web.config file instead of the app.config file.

For a summary of the <assemblyBinding> tag, please refer to the MSDN article Redirecting Assembly Versions.

PoorExcellent