60000359 Compiled project is not working with other VDF version installed.

Article 60000359
Type HowTo
Product Engine
Version 6
Date Added 12/19/2007 12:00:00 AM
Fixed (12/19/2007 12:00:00 AM)
Submitted by Andrey Tomilin

Summary

I have created a simple application that was compiled with VectorDraw control 6009. All VectorDraw dll references was compiled with Specific Version = false and Copy Local = false. This application works on machines with VectorDraw 6009 only and throw an exception if it run on VectorDraw 6011 machine. In the project I don't use any properties/methods/events that are in 6011 but missing or changed in 6009.

Solution

Note: The solution below is not recommended. We reccomend to build and redistribute your application with the same VDF version.

You can redirect the version of VectorDraw dll by distributing a config file. See 'Redirect assembly version' and bindingRedirect in VisualStudio help.  

The config file must be as follow for the VectorDraw assembly dll. Also It must be placed in the same directory with your application .exe and must be renamed using the format (yourapplicationname.exe.config)

This config file will redirect all versions of VectorDraw assemblies with 6.1.6011.0 (Note that these dlls must exist in distribution machine)

<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Actions" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Generics" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Geometry" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Render" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="RenderFormats" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Serialize" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VDrawBaseControl" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="vdCommandLine" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="vdFramedControl" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Professional" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="vdPropertyGrid" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="vdScrollableControl" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="WinMsgMannager" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.ExDialogs" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VectorDraw.Fonts" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VdProControl" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="vdxFcnv" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="OpenVDF" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="vdDXF" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
<dependentAssembly>
   <assemblyIdentity name="VdrawPro5" publicKeyToken="54eac14e23c9ee53" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-6.1.65535.65535" newVersion="6.1.6011.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

The opposite is also possible, like build you exe with 6011 and make it to run with 6009 installed. In this case the properties/methods/events that you are using while you build your project with 6011 should not be changed from 6011 to 6009.

Send comments on this topic.