llblgen v5.2.1,firebird (db v2.5,.net connector v5.12.1.0),llblgen pro runtime framework target platform .net 4.0 , error in windows xp but windows 7 32bit

Posts   
 
    
alonsoChen
User
Posts: 30
Joined: 27-Nov-2017
# Posted on: 13-Feb-2018 09:44:03   

System.TypeInitializationException: The type initializer for 'FirebirdSql.Data.Client.Native.FbClientFactory' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at FirebirdSql.Data.Client.Native.FbClientFactory..cctor() --- End of inner exception stack trace --- at FirebirdSql.Data.Client.Native.FbClientFactory.GetFbClient(String dllName) at FirebirdSql.Data.Client.Native.FesDatabase..ctor(String dllName, Charset charset) at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase(FbConnectionString options) at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect() at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.CreateNewConnectionIfPossibleImpl(FbConnectionString connectionString) at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.GetConnection(FbConnection owner) at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Get(FbConnectionString connectionString, FbConnection owner) at FirebirdSql.Data.FirebirdClient.FbConnection.Open() at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.OpenConnection() at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchDataReader(IRetrievalQuery queryToExecute, CommandBehavior readerBehavior) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchProjection(List1 valueProjectors, IGeneralDataProjector projector, IRetrievalQuery queryToExecute, Boolean performValueProjectionsOnRawRow, Boolean postProcessDBNullValues, Dictionary2 typeConvertersToRun) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchProjection(List1 valueProjectors, IGeneralDataProjector projector, QueryParameters parameters) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>c__DisplayClass22_0.<FetchProjection>b__0() at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteWithActiveRecoveryStrategy(Action toExecute) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchProjection(List1 valueProjectors, IGeneralDataProjector projector, QueryParameters parameters) at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProvider2.ExecuteValueListProjection(QueryExpression toExecute) at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.ExecuteExpression(Expression handledExpression, Type typeForPostProcessing) at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.System.Linq.IQueryProvider.Execute[TResult](Expression expression) at System.Linq.Queryable.Count[TSource](IQueryable`1 source) at webApi.Form1.CheckForBookeInvNumber5Sec_Elapsed(Object sender, ElapsedEventArgs e)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Feb-2018 10:41:17   

I think v5.12.1.0 is for .NET 4.5+ as it relies on Async, did you install the right firebird client version? Could you try an older one?

I don't fully understand your description in the subject btw: you get the error on windows xp but not on windows 7?

Frans Bouma | Lead developer LLBLGen Pro
alonsoChen
User
Posts: 30
Joined: 27-Nov-2017
# Posted on: 13-Feb-2018 10:47:04   

i use the FirebirdSql.Data.FirebirdClient-5.12.1.0-NET40.7z here is the link: https://github.com/FirebirdSQL/NETProvider/releases/download/5.12.1.0/FirebirdSql.Data.FirebirdClient-5.12.1.0-NET40.7z

have try to use ado.net only and the same error occur in windows xp but not in win 7. It seem that the firebird connector issue. any suggestion for the firebird ado.net connector verion working in winXP?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Feb-2018 10:50:49   

I think the .NET version you have on XP doesn't contain the files it depends on. If you go to nuget and look at the dependencies for this version: https://www.nuget.org/packages/FirebirdSql.Data.FirebirdClient/5.12.1 you'll see it depends on 3 files for .NET 4.0 which have to be present, but likely aren't installed on Windows XP as Async was introduced in .NET 4.5 which doesn't install on windows xp.

So I think you need to use an older connector which doesn't have async code and doesn't depend on these dlls. This is a bit of a hassle, admitted, but as windows XP is an OS that's no longer supported by Microsoft, not all latest software runs on it.

(moved to public forum as no info is given yet, and I then can ask Jiri who wrote the Fb client to have a look)

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Feb-2018 11:16:15   

Could you in a try/catch(Exception ex) {} check the LoaderExceptions property of the thrown exception? It's likely in the inner exception object, see the message of the exception thrown: "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."

This might give more insight in what exactly went wrong.

Frans Bouma | Lead developer LLBLGen Pro
alonsoChen
User
Posts: 30
Joined: 27-Nov-2017
# Posted on: 13-Feb-2018 13:19:53   

Otis wrote:

Could you in a try/catch(Exception ex) {} check the LoaderExceptions property of the thrown exception? It's likely in the inner exception object, see the message of the exception thrown: "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."

This might give more insight in what exactly went wrong.

After using FirebirdSql.Data.FirebirdClient ver.4.5.0.0, work fine without the issue exist.

Posts: 95
Joined: 31-Mar-2012
# Posted on: 13-Feb-2018 13:47:36   

As Frans said, providing some info from inner exception(s) might provide some clue. Without that we can't even guess.

alonsoChen
User
Posts: 30
Joined: 27-Nov-2017
# Posted on: 14-Feb-2018 02:31:19   

this is the issue call ado.net connector directly not through llblgen framework System.TypeInitializationException: The type initializer for 'FirebirdSql.Data.Client.Native.FbClientFactory' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at FirebirdSql.Data.Client.Native.FbClientFactory..cctor() --- End of inner exception stack trace --- at FirebirdSql.Data.Client.Native.FbClientFactory.GetFbClient(String dllName) at FirebirdSql.Data.Client.Native.FesDatabase..ctor(String dllName, Charset charset) at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase(FbConnectionString options) at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect() at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.CreateNewConnectionIfPossibleImpl(FbConnectionString connectionString) at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.GetConnection(FbConnection owner) at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Get(FbConnectionString connectionString, FbConnection owner) at FirebirdSql.Data.FirebirdClient.FbConnection.Open() at webApi.Form1.Initial()

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 14-Feb-2018 09:04:59   

simple_smile Yes, but the message says:

Retrieve the LoaderExceptions property for more information.

So the exception contains a property (I don't know the type of the exception), LoaderExceptions, which contain more info what exactly went wrong. That info can be helpful tracking down what it is that makes it throw these exceptions.

Frans Bouma | Lead developer LLBLGen Pro