c# - Type Initializer Error Thrown by linq2db InformixDataProvider when run in Web Application but not Console -
i trying use linq2db library (thanks way!) retrieve records informix database. followed steps documentation , able records asp.net console applicaiton using visual studio debugger. however, tried follow same fresh , standalone asp.net mvc5 application , getting error "the type initializer 'ibm.data.informix.ifxdecimal' threw exception." running using visual studio debugger. did digging downloading source code , adding break points , found line 125 , line 133 of file linqtodb.dataprovider.informix.informixdataprovider file involved in causing error. far got. running in context of web application throws error, running in console application fine.
below line 125 of linqtodb.dataprovider.informix.informixdataprovider
mappingschema.addscalartype(_ifxdecimal, getnullvalue(_ifxdecimal), true, datatype.decimal); below getnullvalue method in class (lines 130 134 of same file), error gets thrown on return getvalue.compile()()
static object getnullvalue(type type) { var getvalue = expression.lambda<func<object>>(expression.convert(expression.field(null, type, "null"), typeof(object))); return getvalue.compile()(); } additional info.. in documentation titled informix client software development kit (version 4.10) in table 2-1. best-fit types retrieving informix data types shows there 3 decimal informix types, each map 3 different suggested .net types
i afraid can't use informix in partial trust environment. when try create ifxconnection in partial trust, securityexception - 'that assembly not allow partially trusted callers.'
Comments
Post a Comment