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:
- Converting the Project File
- Download Migration Templates
- Migrating Your Code
- Demo of LLBLGen V3
- LLBLGen Forums.
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.
- Download & extract the v2.x to v3.x migration templates (it’s the top link)
- 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 FilesSolutions DesignLLBLGen Pro v2.6
- Open your original project file (*.lgp) in LLBLGen 2.6 (or reopen if it was already open)
- Press F7 to generate code
- In the Template group drop down, choose “LLBLGen Pro V3” & press Generate. Your project file *.llblgenproj is now in the “Destination Root Folder”.
- 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:
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 220.127.116.11 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:
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)" ...