473,624 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent help needed on Emit Dynamic Assembly

Hi,All MS Tech Gurus:
I need your help!!! It is the second time I post this message, I need get
some feedback ASAP, Please Help!!
Thanks a lot in advance.
John

I have a csharp method, using emit to dynamically generate classes & method
depends on the meta table in the database,here is my situation
1) In One method I generated the code Dynamic IL Code (Depends on the data
pass to it), The generated code works for one dataset but does not work for
another one, when it does not work, it generate the following error
Object reference not set to an instance of an object
2) The generate method which is not working on one machine is working fine
on a differennt computer with not code change
3) The generate method which is not working on one machine is working fine
on the same machine if run under using visual studio.net (both
debug mode & release mode), I have remove & reinstall VS 2004, it is still
the same.
4) I put some trace in the generated method, looks like the error happened
when the method was called, but has not execute anything on the method yet
(the was
not trace out
5) I am using the following code to call the generated method
public delegate void SetValue( DataRow rw, Object objrtn);
public SetValue delemethod=null ;

private static void ExecSetValue(Ar rayList arr, Object objrtn,CTask
objtask,DataRow rw,string task_id)
{
if (objtask.deleme thod==null)
objtask.delemet hod=BuildStatic DelegateMethod( arr,objrtn,task _id);

if (objtask.deleme thod==null)
Trace.WriteLine ("delemethod is NULLLLLLLLLLLL" ,"ERROR");
objtask.delemet hod(rw,objrtn);
}

}

6) I am using the following code to emit the IL code
static public SetSQLParam BuildStaticDele gateSQL(ArrayLi st objlstsp,Object
O,string task_id)
{

string strClassName="S QLExecSetSQL" + task_id;
TypeBuilder myTypeBuilder = myModule.Define Type(strClassNa me,
TypeAttributes. Public);

string strMethodName=" SetValue" +task_id;

MethodBuilder ParMethod = myTypeBuilder.D efineMethod(str MethodName,
MethodAttribute s.Public | MethodAttribute s.Static , typeof(void),
new Type[] { typeof(Session) ,
typeof(Object),
typeof(SqlParam eter[]),
typeof(CTask),
typeof(String)} );

Label[] arrLoadValueStr ing=new Label[objlstsp.Count];
Label[] arrSetValue=new Label[objlstsp.Count];
ILGenerator ILParaFunc= ParMethod.GetIL Generator(); // Create local
variables.
MethodInfo targetTrace = typeof(Trace).G etMethod("Write Line", new Type[]
{typeof(String) } );

MethodInfo Methodgetitem = typeof(ArrayLis t).GetMethod("g et_Item", new
Type[] {typeof(int)} );
MethodInfo MethodStringEq = typeof(String). GetMethod("op_E quality", new
Type[] {typeof(String) ,typeof(String) } );
MethodInfo MethodSetSPValu e = typeof(SqlParam eter).GetMethod ("set_Value" ,
new Type[] {typeof(Object) } );
MethodInfo MethodXMLList = typeof(SQLExec) .GetMethod("Get XMLInput", new
Type[]
{typeof(CTask), typeof(String), typeof(Object)} );
Type objType=typeof( Object);
if (O!=null)
objType=O.GetTy pe();

FieldInfo fieldmap=objTyp e.GetField("map field_name");
FieldInfo fieldstruct=obj Type.GetField(" structurename") ;
for (int i=0;i<objlstsp. Count;i++)
{
arrLoadValueStr ing[i]=ILParaFunc.Def ineLabel();
arrSetValue[i]=ILParaFunc.Def ineLabel();

CSqlParameter objsp=(CSqlPara meter)objlstsp[i];
FieldInfo fieldvar;

ILParaFunc.Emit (OpCodes.Ldarg_ 2);
ILParaFunc.Emit (OpCodes.Ldc_I4 ,i);
ILParaFunc.Emit (OpCodes.Ldelem _Ref);
if (objsp.mapfield _name=="XMLLIST ")
{
ILParaFunc.Emit (OpCodes.Ldarg_ 3);
ILParaFunc.Emit (OpCodes.Ldarg, 4);
ILParaFunc.Emit (OpCodes.Ldarg_ 1);
ILParaFunc.Emit (OpCodes.Call, MethodXMLList );
ILParaFunc.Emit (OpCodes.Callvi rt,MethodSetSPV alue);
continue;

}
if (objsp.structur ename=="Session ")
{
fieldvar=typeof (Session).GetFi eld(objsp.mapfi eld_name);
ILParaFunc.Emit (OpCodes.Ldarg_ 0);
}
else
{
fieldvar=objTyp e.GetField(objs p.mapfield_name );
ILParaFunc.Emit (OpCodes.Ldarg_ 1);
}
ILParaFunc.Emit (OpCodes.Ldfld, fieldvar);
LocalBuilder objvalue= ILParaFunc.Decl areLocal(fieldv ar.FieldType);
ILParaFunc.Emit (OpCodes.Stloc, objvalue);
ILParaFunc.Emit (OpCodes.Ldloc, objvalue);
if (fieldvar.Field Type.BaseType== typeof(System.V alueType) )
{
ILParaFunc.Emit (OpCodes.Box,fi eldvar.FieldTyp e);
}
else
{
ILParaFunc.Emit (OpCodes.Brtrue ,arrLoadValueSt ring[i]);
ILParaFunc.Emit (OpCodes.Ldstr, "");

ILParaFunc.Emit (OpCodes.Br,arr SetValue[i]);
ILParaFunc.Mark Label(arrLoadVa lueString[i]);

ILParaFunc.Emit (OpCodes.Ldloc, objvalue);
}
ILParaFunc.Mark Label(arrSetVal ue[i]);
ILParaFunc.Emit (OpCodes.Callvi rt,MethodSetSPV alue);
}
ILParaFunc.Emit (OpCodes.Ret );
return (SetSQLParam)De legate.CreateDe legate(
typeof(SetSQLPa ram),
myTypeBuilder.C reateType(),
strMethodName );
7) The Generated IL code that is not working on one machines is

followingc.meth od
public static void SetValue18(clas s [System.Data]System.Data.Dat aRow A_0,
object A_1) cil managed
{
// Code size 355 (0x163)
.maxstack 8
.locals init (class
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY V_0,
object V_1,
object V_2,
object V_3,
object V_4,
object V_5,
object V_6,
object V_7)
IL_0000: ldarg.1
IL_0001: castclass
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY
IL_0006: stloc.0
IL_0007: ldstr "Inside Set Value Method"
IL_000c: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0011: ldarg.0
IL_0012: ldstr "branch"
IL_0017: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_001c: stloc.1
IL_001d: ldloc.1
IL_001e: pop
IL_001f: ldloc.0
IL_0020: ldloc.1
IL_0021: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0026: stfld string
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::BRANCH
IL_002b: ldstr "Inside Set Value Method"
IL_0030: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0035: ldarg.0
IL_0036: ldstr "BranchIdx"
IL_003b: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_0040: stloc.2
IL_0041: ldloc.2
IL_0042: callvirt bool [mscorlib]System.Convert: :IsDBNull(objec t)
IL_0047: brtrue IL_006a
IL_004c: ldloc.0
IL_004d: ldloc.2
IL_004e: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0053: callvirt int64 [mscorlib]System.Int64::P arse(string)
IL_0058: br IL_0065
IL_005d: pop
IL_005e: ldloc.0
IL_005f: ldloc.2
IL_0060: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0065: stfld int64
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::BRANCH IDX
IL_006a: ldstr "Inside Set Value Method"
IL_006f: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0074: ldarg.0
IL_0075: ldstr "first_name "
IL_007a: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_007f: stloc.3
IL_0080: ldloc.3
IL_0081: pop
IL_0082: ldloc.0
IL_0083: ldloc.3
IL_0084: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0089: stfld string
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::FIRSTN AME
IL_008e: ldstr "Inside Set Value Method"
IL_0093: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0098: ldarg.0
IL_0099: ldstr "id"
IL_009e: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_00a3: stloc.s V_4
IL_00a5: ldloc.s V_4
IL_00a7: callvirt bool [mscorlib]System.Convert: :IsDBNull(objec t)
IL_00ac: brtrue IL_00d1
IL_00b1: ldloc.0
IL_00b2: ldloc.s V_4
IL_00b4: callvirt instance string [mscorlib]System.Object:: ToString()
IL_00b9: callvirt int64 [mscorlib]System.Int64::P arse(string)
IL_00be: br IL_00cc
IL_00c3: pop
IL_00c4: ldloc.0
IL_00c5: ldloc.s V_4
IL_00c7: callvirt instance string [mscorlib]System.Object:: ToString()
IL_00cc: stfld int64
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::ID
IL_00d1: ldstr "Inside Set Value Method"
IL_00d6: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_00db: ldarg.0
IL_00dc: ldstr "last_name"
IL_00e1: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_00e6: stloc.s V_5
IL_00e8: ldloc.s V_5
IL_00ea: pop
IL_00eb: ldloc.0
IL_00ec: ldloc.s V_5
IL_00ee: callvirt instance string [mscorlib]System.Object:: ToString()
IL_00f3: stfld string
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::LASTNA ME
IL_00f8: ldstr "Inside Set Value Method"
IL_00fd: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0102: ldarg.0
IL_0103: ldstr "login_name "
IL_0108: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_010d: stloc.s V_6
IL_010f: ldloc.s V_6
IL_0111: pop
IL_0112: ldloc.0
IL_0113: ldloc.s V_6
IL_0115: callvirt instance string [mscorlib]System.Object:: ToString()
IL_011a: stfld string
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::LOGINN AME
IL_011f: ldstr "Inside Set Value Method"
IL_0124: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0129: ldarg.0
IL_012a: ldstr "status"
IL_012f: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_0134: stloc.s V_7
IL_0136: ldloc.s V_7
IL_0138: callvirt bool [mscorlib]System.Convert: :IsDBNull(objec t)
IL_013d: brtrue IL_0162
IL_0142: ldloc.0
IL_0143: ldloc.s V_7
IL_0145: callvirt instance string [mscorlib]System.Object:: ToString()
IL_014a: callvirt int64 [mscorlib]System.Int64::P arse(string)
IL_014f: br IL_015d
IL_0154: pop
IL_0155: ldloc.0
IL_0156: ldloc.s V_7
IL_0158: callvirt instance string [mscorlib]System.Object:: ToString()
IL_015d: stfld bool
[DTO]Honda.CASS.DTO. GETEMPLOYEE_RPL Y_DATAGETEMPLOY EE_RPLY::ISACTI VE
IL_0162: ret
} // end of method SQLExecSet18::S etValue18
6) The Generated IL code that is working on all machines is following
..method public static void SetValue55(clas s
[System.Data]System.Data.Dat aRow A_0,
object A_1) cil managed
{
// Code size 589 (0x24d)
.maxstack 8
.locals init (class
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY V_0,
object V_1,
object V_2,
object V_3,
object V_4,
object V_5,
object V_6,
object V_7,
object V_8,
object V_9,
object V_10,
object V_11,
object V_12,
object V_13)
IL_0000: ldarg.1
IL_0001: castclass
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY
IL_0006: stloc.0
IL_0007: ldstr "Inside Set Value Method"
IL_000c: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0011: ldarg.0
IL_0012: ldstr "condition"
IL_0017: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_001c: stloc.1
IL_001d: ldloc.1
IL_001e: pop
IL_001f: ldloc.0
IL_0020: ldloc.1
IL_0021: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0026: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::CONDITION
IL_002b: ldstr "Inside Set Value Method"
IL_0030: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0035: ldarg.0
IL_0036: ldstr "current_locati on"
IL_003b: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_0040: stloc.2
IL_0041: ldloc.2
IL_0042: pop
IL_0043: ldloc.0
IL_0044: ldloc.2
IL_0045: callvirt instance string [mscorlib]System.Object:: ToString()
IL_004a: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::CURRENTLO
CATION
IL_004f: ldstr "Inside Set Value Method"
IL_0054: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0059: ldarg.0
IL_005a: ldstr "dayspassdu e"
IL_005f: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_0064: stloc.3
IL_0065: ldloc.3
IL_0066: callvirt bool [mscorlib]System.Convert: :IsDBNull(objec t)
IL_006b: brtrue IL_008e
IL_0070: ldloc.0
IL_0071: ldloc.3
IL_0072: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0077: callvirt int64 [mscorlib]System.Int64::P arse(string)
IL_007c: br IL_0089
IL_0081: pop
IL_0082: ldloc.0
IL_0083: ldloc.3
IL_0084: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0089: stfld int64
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::DAYSPASSD
UE
IL_008e: ldstr "Inside Set Value Method"
IL_0093: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0098: ldarg.0
IL_0099: ldstr "elm_objid"
IL_009e: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_00a3: stloc.s V_4
IL_00a5: ldloc.s V_4
IL_00a7: callvirt bool [mscorlib]System.Convert: :IsDBNull(objec t)
IL_00ac: brtrue IL_00d1
IL_00b1: ldloc.0
IL_00b2: ldloc.s V_4
IL_00b4: callvirt instance string [mscorlib]System.Object:: ToString()
IL_00b9: callvirt int64 [mscorlib]System.Int64::P arse(string)
IL_00be: br IL_00cc
IL_00c3: pop
IL_00c4: ldloc.0
IL_00c5: ldloc.s V_4
IL_00c7: callvirt instance string [mscorlib]System.Object:: ToString()
IL_00cc: stfld int64
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::ID
IL_00d1: ldstr "Inside Set Value Method"
IL_00d6: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_00db: ldarg.0
IL_00dc: ldstr "first_name "
IL_00e1: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_00e6: stloc.s V_5
IL_00e8: ldloc.s V_5
IL_00ea: pop
IL_00eb: ldloc.0
IL_00ec: ldloc.s V_5
IL_00ee: callvirt instance string [mscorlib]System.Object:: ToString()
IL_00f3: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::FIRSTNAME
IL_00f8: ldstr "Inside Set Value Method"
IL_00fd: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0102: ldarg.0
IL_0103: ldstr "id_number"
IL_0108: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_010d: stloc.s V_6
IL_010f: ldloc.s V_6
IL_0111: pop
IL_0112: ldloc.0
IL_0113: ldloc.s V_6
IL_0115: callvirt instance string [mscorlib]System.Object:: ToString()
IL_011a: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::STRID
IL_011f: ldstr "Inside Set Value Method"
IL_0124: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0129: ldarg.0
IL_012a: ldstr "last_name"
IL_012f: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_0134: stloc.s V_7
IL_0136: ldloc.s V_7
IL_0138: pop
IL_0139: ldloc.0
IL_013a: ldloc.s V_7
IL_013c: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0141: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::LASTNAME
IL_0146: ldstr "Inside Set Value Method"
IL_014b: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0150: ldarg.0
IL_0151: ldstr "next_contact_d ate"
IL_0156: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_015b: stloc.s V_8
IL_015d: ldloc.s V_8
IL_015f: callvirt bool [mscorlib]System.Convert: :IsDBNull(objec t)
IL_0164: brtrue IL_0189
IL_0169: ldloc.0
IL_016a: ldloc.s V_8
IL_016c: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0171: callvirt valuetype [mscorlib]System.DateTime
[mscorlib]System.DateTime ::Parse(string)
IL_0176: br IL_0184
IL_017b: pop
IL_017c: ldloc.0
IL_017d: ldloc.s V_8
IL_017f: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0184: stfld valuetype [mscorlib]System.DateTime
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::NEXTCONTA
CTDATE
IL_0189: ldstr "Inside Set Value Method"
IL_018e: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0193: ldarg.0
IL_0194: ldstr "oldaccno"
IL_0199: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_019e: stloc.s V_9
IL_01a0: ldloc.s V_9
IL_01a2: pop
IL_01a3: ldloc.0
IL_01a4: ldloc.s V_9
IL_01a6: callvirt instance string [mscorlib]System.Object:: ToString()
IL_01ab: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::OLDACCOUN
TNUMBER
IL_01b0: ldstr "Inside Set Value Method"
IL_01b5: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_01ba: ldarg.0
IL_01bb: ldstr "orig_branch_no "
IL_01c0: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_01c5: stloc.s V_10
IL_01c7: ldloc.s V_10
IL_01c9: pop
IL_01ca: ldloc.0
IL_01cb: ldloc.s V_10
IL_01cd: callvirt instance string [mscorlib]System.Object:: ToString()
IL_01d2: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::ORIGINATI
NGBRANCH
IL_01d7: ldstr "Inside Set Value Method"
IL_01dc: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_01e1: ldarg.0
IL_01e2: ldstr "originator "
IL_01e7: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_01ec: stloc.s V_11
IL_01ee: ldloc.s V_11
IL_01f0: pop
IL_01f1: ldloc.0
IL_01f2: ldloc.s V_11
IL_01f4: callvirt instance string [mscorlib]System.Object:: ToString()
IL_01f9: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::ORIGINATO
R
IL_01fe: ldstr "Inside Set Value Method"
IL_0203: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_0208: ldarg.0
IL_0209: ldstr "title"
IL_020e: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_0213: stloc.s V_12
IL_0215: ldloc.s V_12
IL_0217: pop
IL_0218: ldloc.0
IL_0219: ldloc.s V_12
IL_021b: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0220: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::TITLE
IL_0225: ldstr "Inside Set Value Method"
IL_022a: callvirt void
[System]System.Diagnost ics.Trace::Writ eLine(string)
IL_022f: ldarg.0
IL_0230: ldstr "type"
IL_0235: callvirt instance object
[System.Data]System.Data.Dat aRow::get_Item( string)
IL_023a: stloc.s V_13
IL_023c: ldloc.s V_13
IL_023e: pop
IL_023f: ldloc.0
IL_0240: ldloc.s V_13
IL_0242: callvirt instance string [mscorlib]System.Object:: ToString()
IL_0247: stfld string
[DTO]Honda.CASS.DTO. GETCASEBYWIPBIN _RPLY_DATAGETCA SEBYWIPBIN_RPLY ::TYPE
IL_024c: ret
} // end of method SQLExecSet55::S etValue55
Nov 16 '05 #1
0 1889

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1809
by: aerge calderara | last post by:
dear all, I am using the GetTypes method of an assembly object in order to check that it implement a particular needed interface for my application. system.Reflexion.Assembly.LoadFrom(sFile).GetTypes was working fine until today where I get an error saying that all type in assembly cannot be loaded.
2
5185
by: DEK | last post by:
I'm creating a dynamic assembly which has one type with one constructor, the type inherits a base class Season, which is in the current assembly. I am trying to emit a constructor which simply calls the base constructor with the 4 args passed in, but I get this error Message at the second last line of the method CreateSeason (Marked with <<<<<) An unhandled exception of type 'System.MissingMethodException' occurred in mscorlib.dll ...
0
2763
by: john | last post by:
Is there a way to use the Reflection.Emit namespace classes to load an existing assembly, then modify it by emitting IL to the loaded assembly, then saving the modified assembly back to a file? Thanks, John
1
3035
by: Matthias Klöpper | last post by:
Hi there, I'm currently trying to call some API-Functions via Reflection.Emit since I need to bind to different dlls based on user input. The dynamic creation of the required PInvoke-Methods works just fine and when invoked the functions are executed perfectly well. The only problem is that I seem to be unable to get back any return values. To simplify the whole case I created a test-setup that binds to user32.dll, dynamically creates a...
8
2536
by: Eyeawanda Pondicherry | last post by:
I have put some code together that creates an enum dynamically from some database values. The enum can be read perfectly by an application that references the dynamically generated dll. If I /emit/ a new version of the assembly, and start the application again, the new values will appear for the enum. However, suppose I want the application to remain in a running state.
4
3063
by: Gianluca | last post by:
This is the simplified code I'm trying to generate: ilg.DeclareLocal(typeof(int)); // define local integer Label exit = ilg.DefineLabel(); // define "exit" label ilg.Emit(OpCodes.Ldc_I4_0); // put 0 on the stack ilg.Emit(OpCodes.Stloc_0); // set the local integer to 0 ilg.Emit(OpCodes.Ldloc_0); // load the local integer (0) on the stack ilg.Emit(OpCodes.Ldc_I4_1); // load integer 1 on the stack
3
1589
by: Mark Keogh | last post by:
Hi, Why is everything some confusng when MS are involved ;-) Anyway, I have my excel export routines working fine, now when I try to build them into my assembly, which has a strong name, I get the Unable to emit assembly: Referenced assembly 'Interop.VBIDE' does not have a strong name message and everything stops. Now I searched the NET and all I can find is
3
1573
by: magounc | last post by:
I am new to creating dynamic methods and I find that I have need to do so. I have read through some IL and emit examples and have gotten some simple programs to work. However, I cannot seem to use the opcode Call correctly. This example gives me an "CLR detectd and invalid program" exception at the line handler.invoke. I am sure the error is a simple one. Could someone help me? public partial class ILTest : System.Web.UI.Page {...
2
4480
by: joasi | last post by:
Hi, I am working in C# with an Object / Relational Database mapping framework, where I want to generate method calls based on string representation of the call signature. I have used reflection and Method-/Field-/PropertyInfo invokation to do this, but now I want to make the calls faster by using Emit and DynamicMethods I am now trying to create a factory method that creates a dynamic method as a "wrapper" around a method call with no...
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.