Migrating an LLBLGen Project from 2.X to 3.X

By Josh Wright on October 2011 in tips

 

Migrating a project from V2 to V3 LLBLGen project was a huge pain. Since I work in 30+ projects that use V2, I decided to write out all the not-so-obvious steps required.

Half the battle is just finding these links:

Step 1) Back Everything Up

Use git or just copy your files into another directory. You'll be making some fierce changes to references, code, & your project file.

Step 2) Convert Your Project

In LLBLGen V2 the project file is a binary .lgp file. In V3 it becomes an XML .llblgenproj so you need to convert your project file.

I wish you could just open your old project in the new program and it would automatically convert it for you, but it is WAAAAY more complicated.

  1. Download & extract the v2.x to v3.x migration templates (it's the top link)
  2. Copy everything in that folder into the root folder of your LLBLGen 2.6 program directory. For me that means: copy C:\V2xMigrationTemplates_20110207 to C:\Program Files\Solutions Design\LLBLGen Pro v2.6
  3. Open your original project file (*.lgp) in LLBLGen 2.6 (or reopen if it was already open)
  4. Press F7 to generate code
  5. In the Template group drop down, choose "LLBLGen Pro V3" & press Generate. Your project file *.llblgenproj is now in the "Destination Root Folder".
  6. Close LLBLGen, delete your old .lgp project, and place your .llblgenproj wherever you want it.

At this point, you can open the .llblgenproj with V3 & generate code just like normal.

Step 3) New DLLs

Now your *.dll references are messed up so your project doesn't build anymore. For SqlServer, projects have 3 dependencies:

  • SD.LLBLGen.Pro.DQE.SqlServer.NET20.dll
  • SD.LLBLGen.Pro.LinqSupportClasses.NET35.dll
  • SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll

You need to delete these out of your lib (in your project), delete them from your project references, & clean your solution.

Now re-add them in Visual Studio by clicking "Add Reference" then selecting them from your GAC. You need to add version 3.1.0.0 of each assembly:

  • LLBLGen Pro Dynamic Query Engine for SqlServer
  • LLBLGen Pro Linq Support Classes library
  • LLBLGen Pro ORM Support Classes Library

In my opinion you should set these as 'copy local', then build, then copy them out of the bin into a lib, then reference the ones in your lib (instead of the GAC). This makes your project build on a computer that doesn't have LLBLGen3 installed.

Step 4) Build Errors

SelfServicing V3 got rid of both DbUtils classes so you need to delete them. They are:

  • /HelperClasses/DbUtils.cs
  • /HelperClasses/DbUtilsComPlus.com

Step 5) Connection String

The connection string name changed from v2 to v3, so you'll need to change your web or app config from

<add name="Main.ConnectionString" ...

to this new version:

<add name="Main.ConnectionString.SQL Server (SqlClient)" ...