Migrating your code

Preface

With every release of the runtime libraries, designer and accompanying template sets new features are added and changes are made to fix bugs or design flaws. While we do everything we can to avoid breakage of your code, some changes are unavoidable. This section illustrates some important points to consider when you move your own code using the LLBLGen Pro generated code to the v2.6 templates and updated runtime libraries (version number: 2.6.0.0).

Before you proceed, please read the following important notice:

note Important:
Please make backup copies of your work before migrating to v2.6. That is: make backups of your own code and the generated code and the .lgp file before using LLBLGen Pro v2.6. This way you can roll back to your original work and continue working with 2.5 or earlier versions if you decide that migration to v2.6 requires more work than you anticipated and you have to complete it at a later date.


note Important:
If you're generating new v2.6 code on top of a project generated with v2.5 or v2.0, it can be that when you load the project(s) into VS.NET, the references to the runtime libraries are still pointing to the v2.5 runtime libraries or v2.0 runtime libraries. Please make sure you manually update these references to the v2.6 runtime libraries, and if applicable, add the reference to the LinqSupportClasses. See for more details about referencing the runtime libraries the section Compiling your code.


Furthermore, it's key to regenerate the code and also to check if you're indeed referencing the proper runtime libraries.

Below are the list of breaking changes in every 2.x version, starting with the latest version, v2.6. If you're migrating from 1.0.200x.y to v2.6, be sure you read all the breaking changes on this page. If you're migrating from v2.0 to v2.6, you need to check the breaking changes in both the v2.5 and v2.6 sections. If you're migrating from v2.5, you've to check the v2.6 section only. If you run into a breaking change which isn't enlisted here, please let us know so we can add it here.

Migrating generated code from version v2.5 to v2.6 runtime libraries

Please consult the What's new? page for breaking changes. We've also enlisted them below for convenience. In general they're minor but you should nevertheless read the list and check whether they affect your code. A lot of the breaking changes are made on the .NET 2.0+ code only. This is due to the fact that the .NET 1.x codebase has reached its end of life (as well as the CF.NET 1.x code). LLBLGen Pro v2.6 does ship with .NET 1.x code support, but not a lot of the changes in v2.6 are made to that codebase as well. You're encouraged to upgrade to at least .NET 2.0.

Breaking changes v2.6

Runtime libraries
Templates, generated code.

Breaking changes v2.5

Runtime libraries
Templates

Migrating generated code from any previous version to 2.0.0.0 runtime libraries

You have to re-generate the code and recompile the generated code as well as to recompile your own code which references the runtime libraries of LLBLGen Pro (ORM Support Classes and / or DQE). Be sure you reference the new runtime libraries.

Your code will likely not compile at this point. Don't panic, we've created a list below with the important changes in the generated code / runtime libraries. The list is also important for code behavior changes at runtime as we made a small set of changes which could affect runtime behavior, as in: null reference exceptions because you access a property in your code which now returns null instead of a guaranteed value.

This guide assumes you're on 1.0.2005.1. If you're on an older version, you might run into one or two breaking changes depending on the current LLBLGen Pro version you're using, however in almost all cases these are compile time breakings, very rare and easy to fix. If you're using a lot of custom templates it might be you will run into more problems than which are listed below, which can be solved by updating your templates, which you have to do anyway due to the new template configuration system.

Breaking changes v2.0

General

Adapter specific

SelfServicing specific

Note: You can request the version of the runtime libraries you're currently using in your code using:

// C#
string version = SD.LLBLGen.Pro.ORMSupportClasses.RuntimeLibraryVersion.Version + "." + 
	SD.LLBLGen.Pro.ORMSupportClasses.RuntimeLibraryVersion.Build;
' VB.NET
Dim version As String = SD.LLBLGen.Pro.ORMSupportClasses.RuntimeLibraryVersion.Version & "." & _ 
	SD.LLBLGen.Pro.ORMSupportClasses.RuntimeLibraryVersion.Build

The runtime libraries have a file version attribute as well, besides the 2.6.0.0 version. You can request that version attribute's value by clicking with the right-mousebutton on the .dll and select 'Properties' and in the dialog that pops up, select the Version tab. The version format is: 2.6.08.mmdd.

LLBLGen Pro v2.6 documentation. ©2002-2008 Solutions Design