How to deploy .NET applications that use modules/libraries with different version than the development ones

2 comments -

Because with new versions of connectors or another external libraries there may be some compatibility issues, developers of .NET applications may find themselves in the next situation

  • on developer machine they are forced to install these new versions of the external libraries or modules
  • on the client machine, with different software or hardware configuration, there are compatibility issues with the new library/module (it can’t be installed or it generate runtime exceptions)

The scenario that I have encountered is this:

  • .NET Windows application that uses 2.0 .NET framework
  • the application was developed in Visual Studio 2008
  • the application connect to a MySQL database using connector/NET from MySQL.com
  • the application uses Crystal Reports as reporting services

After updating the IDE to VS2010 some problems have emerged:

The solution that allows the deployment of .NET applications that use modules/libraries with different version than the modules used in development:

  • open/add the configuration file of the WinForm .NET application  –  App.config (to add this file, in Solution explorer right click on the project name then Add -> New item -> Application Configuration File)
  • the configuration file is an XML file that can be edited;
  • add next settings between the <configuration></configuration> attributes (the solution for Crystal Reports is better described in Deploying Crystal Reports for Visual Studio 2010 Beta on http://www.sdn.sap.com/irj/sdn/sbo-solutions)
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
 
      <!--for Crystal Reports modules-->
 
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.Enterprise.Framework" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.1100.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.Enterprise.InfoStore" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.1100.0"/>
      </dependentAssembly>
 
      <!--for MySql module-->
 
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="692fbea5521e1304"/>
        <bindingRedirect oldVersion="6.3.4.0" newVersion="6.1.2.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
  • using App.config configuration file, we instruct the .NET process to use modules/libraries with different version than the ones used in development
  • this solution works if there are not major differences between functions described in these modules and used by the application
  • when deploying the WinForm application do not forget to take also the [ApplicationName].exe.config that is an editable XML (it can be edited on the client machine) file identical with the App.config file
  • for ASP.NET applications the solution is similar because the settings are added also to <configuration></configuration>

,


  1. #1 by Peter on June 11th, 2012

    Hello, am Peter. we have a Linux server and i just created a windows application interface using C#, I want to know if it can work on Linux O.S. the database i used was mysql database.thank u.

(will not be published)