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

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)
  
    
      
      
      
      
        
        
      
      
        
        
      
      
        
        
      
      
        
        
      
      
        
        
      
      
        
        
      
      
      
      
      
        
        
      
    
  

  • 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>