Firebird 2.5 on LLBLGen Pro 2.6 exception

Posts   
 
    
godra123
User
Posts: 6
Joined: 02-Oct-2012
# Posted on: 02-Oct-2012 11:19:21   

Hi!

I am running Firebird 2.5 on Windows 7, x64 machine. I've created test database and i've tried to create a new project in LLBLGen Pro 2.6 Designer. I've managed to test database connection and it went OK ("Test connection succeeded"). Next, when I click "Create" buttton, following exception appears:


.NET Exception information: Method not found: 'FirebirdSql.Data.FirebirdClient.FbError FirebirdSql.Data.FirebirdClient.FbErrorCollection.get_Item(Int32)'.

Stack trace: -----[Core exception]-------------------- at SD.LLBLGen.Pro.DBDrivers.Firebird.FirebirdSchemaRetriever.RetrieveAllTablesViews(FbConnection openConnection) at SD.LLBLGen.Pro.DBDrivers.Firebird.FirebirdSchemaRetriever.RetrieveSchema(String connectionString, IDBSchema schemaToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.Firebird.FirebirdCatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.Firebird.FirebirdDBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties) at SD.LLBLGen.Pro.Gui.Forms.NewProjectWizard.CreateNewProject()

Source: SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver


Note: I've installed FirebirdClient v2.7.7.0 I've added "FirebirdSql.Data.FirebirdClient.dll" to GAC I've set binding redirect in LLBLGenPro.exe.config file: <dependentAssembly> <assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c"/> <bindingRedirect oldVersion="2.0.1.0" newVersion="2.7.7.0"/> </dependentAssembly>

Can anyone help?

Thnx dependentAssembly

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39873
Joined: 17-Aug-2003
# Posted on: 02-Oct-2012 15:07:22   

Did you install the .net 3.5/2.0 version of the provider? The default one is .net 4.

Frans Bouma | Lead developer LLBLGen Pro
godra123
User
Posts: 6
Joined: 02-Oct-2012
# Posted on: 02-Oct-2012 15:31:36   

Otis wrote:

Did you install the .net 3.5/2.0 version of the provider? The default one is .net 4.

I've tried adding every possible FirebirdSql.Data.FirebirdClient.ddl file to GAC, but same result. There is only one .NET provider installation file ("NETProvider-2.7.7.msi"), others are zipped dll files. (except FirebirdNETProvider-1.7.2.exe file, which is for .NET Framework 1.1).

I've also tried to change runtime version in LLBLGenPro.exe.config, but no luck there either.

Do you have any other solution maybe?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39873
Joined: 17-Aug-2003
# Posted on: 02-Oct-2012 21:12:47   

I'll notify the firebird .NET provider developer about this, as I don't know what can be wrong. Though I do think it's .net 4 <-> .net 2/3.5 related.

Could you check what fuslogvw.exe (tool in .net sdk) shows with llblgenpro.exe ? It should show which assembly it tried to load and couldn't find.

Frans Bouma | Lead developer LLBLGen Pro
godra123
User
Posts: 6
Joined: 02-Oct-2012
# Posted on: 03-Oct-2012 09:10:21   

Otis wrote:

I'll notify the firebird .NET provider developer about this, as I don't know what can be wrong. Though I do think it's .net 4 <-> .net 2/3.5 related.

Could you check what fuslogvw.exe (tool in .net sdk) shows with llblgenpro.exe ? It should show which assembly it tried to load and couldn't find.

Alright, here the log for SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver.dll:

*** Assembly Binder Log Entry (3.10.2012. @ 9:05:17) ***

The operation was successful. Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll Running under executable C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\LLBLGenPro.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: User = DMILETIC\drago LOG: Where-ref bind. Location = C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\Drivers\Firebird\SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver.dll LOG: Appbase = filedisappointed //Cdisappointed Program Files (x86)/Solutions Design/LLBLGen Pro v2.6/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = LLBLGenPro.exe

Calling assembly : (Unknown).

LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\LLBLGenPro.exe.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config. LOG: Attempting download of new URL filedisappointed //Cdisappointed Program Files (x86)/Solutions Design/LLBLGen Pro v2.6/Drivers/Firebird/SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver.dll. LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\Drivers\Firebird\SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver.dll LOG: Entering run-from-source setup phase. LOG: Assembly Name is: SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27 LOG: Re-apply policy for where-ref bind. LOG: Post-policy reference: SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27 LOG: Found assembly by looking in the GAC. LOG: Switch from LoadFrom context to default context. LOG: Binding succeeds. Returns assembly from C:\Windows\assembly\GAC_MSIL\SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver\2.6.0.0__ca73b74ba4e3ff27\SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver.dll. LOG: Assembly is loaded in default load context.

This happens when I open LLBLGen Pro 2.6, and try to create new project with firebird driver.

This is log for FirebirdSql.Data.FirebirdClient.dll:

*** Assembly Binder Log Entry (3.10.2012. @ 9:05:51) ***

The operation was successful. Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll Running under executable C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\LLBLGenPro.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: User = DMILETIC\drago LOG: DisplayName = FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c (Fully-specified) LOG: Appbase = filedisappointed //Cdisappointed Program Files (x86)/Solutions Design/LLBLGen Pro v2.6/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = LLBLGenPro.exe

Calling assembly : SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27.

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\LLBLGenPro.exe.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config. LOG: Redirect found in application configuration file: 2.0.1.0 redirected to 2.7.7.0. LOG: Post-policy reference: FirebirdSql.Data.FirebirdClient, Version=2.7.7.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c LOG: Found assembly by looking in the GAC. LOG: Binding succeeds. Returns assembly from C:\Windows\assembly\GAC_MSIL\FirebirdSql.Data.FirebirdClient\2.7.7.0__3750abcc3150b00c\FirebirdSql.Data.FirebirdClient.dll. LOG: Assembly is loaded in default load context.

godra123
User
Posts: 6
Joined: 02-Oct-2012
# Posted on: 03-Oct-2012 09:24:15   

I found one error in logs, here it is:

*** Assembly Binder Log Entry (3.10.2012. @ 9:19:3sunglasses ***

The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll Running under executable C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\LLBLGenPro.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: User = DMILETIC\drago LOG: DisplayName = LLBLGenPro.resources, Version=2.6.0.0, Culture=en-US, PublicKeyToken=ca73b74ba4e3ff27 (Fully-specified) LOG: Appbase = filedisappointed //Cdisappointed Program Files (x86)/Solutions Design/LLBLGen Pro v2.6/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = LLBLGenPro.exe

Calling assembly : LLBLGenPro, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27.

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\LLBLGenPro.exe.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config. LOG: Post-policy reference: LLBLGenPro.resources, Version=2.6.0.0, Culture=en-US, PublicKeyToken=ca73b74ba4e3ff27 LOG: The same bind was seen before, and was failed with hr = 0x80070002. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).

Posts: 95
Joined: 31-Mar-2012
# Posted on: 03-Oct-2012 10:34:29   

I think there's a problem with FirebirdClient version. It's not the one LLBLGen Pro is expecting.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39873
Joined: 17-Aug-2003
# Posted on: 03-Oct-2012 10:52:25   

Ah, that can be it indeed...

It dies with an exception, and it tries to read the errors, using an FbException. The code was compiled against v2.0.1 of the Firebird client. It does this:


catch (FbException ex)
{
    // bubble the exception in the form of an ApplicationException. Build the message with the error reported by the
    // Fb Provider
    StringBuilder exceptionMessage = new StringBuilder();

    for (int j = 0; j < ex.Errors.Count; j++)
    {
        exceptionMessage.Append("Index #" + j + "\n" +
            "Message: " + ex.Errors[j].Message + "\n" +
            "Number: " + ex.Errors[j].Number + "\n");
    }
    throw new ApplicationException(exceptionMessage.ToString(), ex);
}

I think the 'Errors' part is no longer valid with higher versions of the firebird client, hence the missing method exception.

Jiri, was there a breaking change in this area?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 95
Joined: 31-Mar-2012
# Posted on: 03-Oct-2012 10:55:55   

Probably yes. This version is very old.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39873
Joined: 17-Aug-2003
# Posted on: 03-Oct-2012 11:02:46   

Ok.

@godra123 : Please get the v2.6 driver's sourcecode from the customer area, it's in the SDK. Only load the firebird project into vs.net and reference the 2.7.x firebird assembly. This will make the driver not compile on the code above. Fix it manually to make it compile. You can also comment out the catch clause entirely to make it compile.

In v3 we got rid of the ado.net provider specific code, so this error won't be a problem there.

Frans Bouma | Lead developer LLBLGen Pro
godra123
User
Posts: 6
Joined: 02-Oct-2012
# Posted on: 03-Oct-2012 12:41:09   

Otis wrote:

Ok.

@godra123 : Please get the v2.6 driver's sourcecode from the customer area, it's in the SDK. Only load the firebird project into vs.net and reference the 2.7.x firebird assembly. This will make the driver not compile on the code above. Fix it manually to make it compile. You can also comment out the catch clause entirely to make it compile.

In v3 we got rid of the ado.net provider specific code, so this error won't be a problem there.

That did the trick! sunglasses

So again, here's what I did: 1.) Downloaded "LLBLGenProSDK_09132012.zip" from customer area. 2.) Unpacked it, and loaded only "FirebirdDBDriver" project 3.) Referenced "FirebirdSql.Data.FirebirdClient.dll" from GAC and "SD.LLBLGen.Pro.DBDriverCore.dll" from LLBLGen Pro installation folder 4.) Uncommented all FbException catch code parts ("..catch(FbException ex)...") 5.) Generated new key pair with sn.exe tool and changed line in AssemblyInfo.cs "[assembly: AssemblyKeyFile("C:\Myproject\mystrongkey.key")]" to point to my new key pair file 6.) Rebuilded solution (Release build) 7.) Replaced old "SD.LLBLGen.Pro.DBDrivers.FirebirdDBDriver.dll" with the new one.

Please confirm that I did everything right.

Thank you very much! simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39873
Joined: 17-Aug-2003
# Posted on: 03-Oct-2012 16:18:09   

Yep that's about it simple_smile

Frans Bouma | Lead developer LLBLGen Pro