line of code not compiled

J

Joe Simmonds

Hi All,
I have just had a problem with some VB.net, I wonder if anybody can shed a little light and ease my confused brain. The problem is resolved now but I can't work out what happened and, more importantly, I can't guarantee it won't happen again. Have I misunderstood the situation? Can anybody help?

An error was spotted in a running application (A new build had just been deployed). When we stepped through the source the debugger would step completely over a line of code without executing it. When I ran ILDASM on the dll with show source lines the source line that was being missed out would be shown but no compiled code seemed to have been inserted into the dll. Below is a transcript of the ildasm output. The line 164 (in the VB source) where a call to Me.SelectAddParms seems to generate no il code at all. The il code for all the following vb source lines seems also to have been moved up to the line above.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_000e: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0013: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0018: ldc.i4.0
IL_0019: ble.s IL_0040
//000165: If Me.Select.Rows.Count > 0 Then
IL_001b: ldarg.0
IL_001c: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0021: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0026: ldc.i4.0
IL_0027: callvirt instance class [System.Data]System.Data.DataRow [System.Data]System.Data.DataRowCollection::get_Item(int32)
IL_002c: ldstr "ContactID"
IL_0031: callvirt instance object [System.Data]System.Data.DataRow::get_Item(string)
IL_0036: call int32 [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType::FromObject(object)
IL_003b: stloc.0
IL_003c: br.s IL_0046
IL_003e: br.s IL_0045

Rebuilding this dll individually seemed to have no effect but the problem was resolved by building all of the dlls in the project, some of which this code uses. A transcript of the ILDASM output for the same section after the resolution is below. Four additional lines of il were produced. These lines are the call to the required method. No changes to the source code were made.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: ldc.i4.s 16
IL_000b: ldarg.1
IL_000c: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::SelectAddParms(int32,
object)
IL_0011: nop
//000165: If Me.Select.Rows.Count > 0 Then
IL_0012: ldarg.0
IL_0013: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0018: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_001d: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0022: ldc.i4.0
IL_0023: ble.s IL_004a

Many Thanks
Joe Simmonds
 
O

One Handed Man \( OHM#\)

What happens if you create a completely fresh project and put just enough code to run that particular line ?

OHM
Hi All,
I have just had a problem with some VB.net, I wonder if anybody can shed a little light and ease my confused brain. The problem is resolved now but I can't work out what happened and, more importantly, I can't guarantee it won't happen again. Have I misunderstood the situation? Can anybody help?

An error was spotted in a running application (A new build had just been deployed). When we stepped through the source the debugger would step completely over a line of code without executing it. When I ran ILDASM on the dll with show source lines the source line that was being missed out would be shown but no compiled code seemed to have been inserted into the dll. Below is a transcript of the ildasm output. The line 164 (in the VB source) where a call to Me.SelectAddParms seems to generate no il code at all. The il code for all the following vb source lines seems also to have been moved up to the line above.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_000e: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0013: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0018: ldc.i4.0
IL_0019: ble.s IL_0040
//000165: If Me.Select.Rows.Count > 0 Then
IL_001b: ldarg.0
IL_001c: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0021: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0026: ldc.i4.0
IL_0027: callvirt instance class [System.Data]System.Data.DataRow [System.Data]System.Data.DataRowCollection::get_Item(int32)
IL_002c: ldstr "ContactID"
IL_0031: callvirt instance object [System.Data]System.Data.DataRow::get_Item(string)
IL_0036: call int32 [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType::FromObject(object)
IL_003b: stloc.0
IL_003c: br.s IL_0046
IL_003e: br.s IL_0045

Rebuilding this dll individually seemed to have no effect but the problem was resolved by building all of the dlls in the project, some of which this code uses. A transcript of the ILDASM output for the same section after the resolution is below. Four additional lines of il were produced. These lines are the call to the required method. No changes to the source code were made.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: ldc.i4.s 16
IL_000b: ldarg.1
IL_000c: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::SelectAddParms(int32,
object)
IL_0011: nop
//000165: If Me.Select.Rows.Count > 0 Then
IL_0012: ldarg.0
IL_0013: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0018: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_001d: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0022: ldc.i4.0
IL_0023: ble.s IL_004a

Many Thanks
Joe Simmonds
 
J

Joe Simmonds

Thanks for the response,
I have created a minimal implementation and the compiles fine and produces the expected il. I would like to add that the original project also produces the expected il when built. It was just that one build that caused a problem. I have not yet been able to reproduce it at all since the entire solution was rebuilt. We have a working build and the problem does not seem to reoccur I just want to know what happened for my own peace of mind.

Thanks

Joe
"One Handed Man ( OHM#)" <news.microsoft.com> wrote in message What happens if you create a completely fresh project and put just enough code to run that particular line ?

OHM
Hi All,
I have just had a problem with some VB.net, I wonder if anybody can shed a little light and ease my confused brain. The problem is resolved now but I can't work out what happened and, more importantly, I can't guarantee it won't happen again. Have I misunderstood the situation? Can anybody help?

An error was spotted in a running application (A new build had just been deployed). When we stepped through the source the debugger would step completely over a line of code without executing it. When I ran ILDASM on the dll with show source lines the source line that was being missed out would be shown but no compiled code seemed to have been inserted into the dll. Below is a transcript of the ildasm output. The line 164 (in the VB source) where a call to Me.SelectAddParms seems to generate no il code at all. The il code for all the following vb source lines seems also to have been moved up to the line above.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_000e: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0013: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0018: ldc.i4.0
IL_0019: ble.s IL_0040
//000165: If Me.Select.Rows.Count > 0 Then
IL_001b: ldarg.0
IL_001c: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0021: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0026: ldc.i4.0
IL_0027: callvirt instance class [System.Data]System.Data.DataRow [System.Data]System.Data.DataRowCollection::get_Item(int32)
IL_002c: ldstr "ContactID"
IL_0031: callvirt instance object [System.Data]System.Data.DataRow::get_Item(string)
IL_0036: call int32 [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType::FromObject(object)
IL_003b: stloc.0
IL_003c: br.s IL_0046
IL_003e: br.s IL_0045

Rebuilding this dll individually seemed to have no effect but the problem was resolved by building all of the dlls in the project, some of which this code uses. A transcript of the ILDASM output for the same section after the resolution is below. Four additional lines of il were produced. These lines are the call to the required method. No changes to the source code were made.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: ldc.i4.s 16
IL_000b: ldarg.1
IL_000c: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::SelectAddParms(int32,
object)
IL_0011: nop
//000165: If Me.Select.Rows.Count > 0 Then
IL_0012: ldarg.0
IL_0013: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0018: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_001d: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0022: ldc.i4.0
IL_0023: ble.s IL_004a

Many Thanks
Joe Simmonds
 
O

One Handed Man \( OHM#\)

I think in all probability, this is a bug which may occur occasionally. When I experience these problems I rarely put effort into it unless I can either repeat it or it is absolutely vital that this must never happen again, such as writing robust code for medical applications where no scope for error must be allowed.

Do what they do in China, put it in the pigeon hole unless it happens again. It was probably something to do with Venus crossing the sun.

Regards - OHM

Thanks for the response,
I have created a minimal implementation and the compiles fine and produces the expected il. I would like to add that the original project also produces the expected il when built. It was just that one build that caused a problem. I have not yet been able to reproduce it at all since the entire solution was rebuilt. We have a working build and the problem does not seem to reoccur I just want to know what happened for my own peace of mind.

Thanks

Joe
"One Handed Man ( OHM#)" <news.microsoft.com> wrote in message What happens if you create a completely fresh project and put just enough code to run that particular line ?

OHM
Hi All,
I have just had a problem with some VB.net, I wonder if anybody can shed a little light and ease my confused brain. The problem is resolved now but I can't work out what happened and, more importantly, I can't guarantee it won't happen again. Have I misunderstood the situation? Can anybody help?

An error was spotted in a running application (A new build had just been deployed). When we stepped through the source the debugger would step completely over a line of code without executing it. When I ran ILDASM on the dll with show source lines the source line that was being missed out would be shown but no compiled code seemed to have been inserted into the dll. Below is a transcript of the ildasm output. The line 164 (in the VB source) where a call to Me.SelectAddParms seems to generate no il code at all. The il code for all the following vb source lines seems also to have been moved up to the line above.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_000e: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0013: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0018: ldc.i4.0
IL_0019: ble.s IL_0040
//000165: If Me.Select.Rows.Count > 0 Then
IL_001b: ldarg.0
IL_001c: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0021: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0026: ldc.i4.0
IL_0027: callvirt instance class [System.Data]System.Data.DataRow [System.Data]System.Data.DataRowCollection::get_Item(int32)
IL_002c: ldstr "ContactID"
IL_0031: callvirt instance object [System.Data]System.Data.DataRow::get_Item(string)
IL_0036: call int32 [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType::FromObject(object)
IL_003b: stloc.0
IL_003c: br.s IL_0046
IL_003e: br.s IL_0045

Rebuilding this dll individually seemed to have no effect but the problem was resolved by building all of the dlls in the project, some of which this code uses. A transcript of the ILDASM output for the same section after the resolution is below. Four additional lines of il were produced. These lines are the call to the required method. No changes to the source code were made.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: ldc.i4.s 16
IL_000b: ldarg.1
IL_000c: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::SelectAddParms(int32,
object)
IL_0011: nop
//000165: If Me.Select.Rows.Count > 0 Then
IL_0012: ldarg.0
IL_0013: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0018: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_001d: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0022: ldc.i4.0
IL_0023: ble.s IL_004a

Many Thanks
Joe Simmonds
 
J

Joe Simmonds

I think that's probably good advice. I'll let it go unless it happens again later.

thanks for your help

Joe
"One Handed Man ( OHM#)" <news.microsoft.com> wrote in message I think in all probability, this is a bug which may occur occasionally. When I experience these problems I rarely put effort into it unless I can either repeat it or it is absolutely vital that this must never happen again, such as writing robust code for medical applications where no scope for error must be allowed.

Do what they do in China, put it in the pigeon hole unless it happens again. It was probably something to do with Venus crossing the sun.

Regards - OHM

Thanks for the response,
I have created a minimal implementation and the compiles fine and produces the expected il. I would like to add that the original project also produces the expected il when built. It was just that one build that caused a problem. I have not yet been able to reproduce it at all since the entire solution was rebuilt. We have a working build and the problem does not seem to reoccur I just want to know what happened for my own peace of mind.

Thanks

Joe
"One Handed Man ( OHM#)" <news.microsoft.com> wrote in message What happens if you create a completely fresh project and put just enough code to run that particular line ?

OHM
Hi All,
I have just had a problem with some VB.net, I wonder if anybody can shed a little light and ease my confused brain. The problem is resolved now but I can't work out what happened and, more importantly, I can't guarantee it won't happen again. Have I misunderstood the situation? Can anybody help?

An error was spotted in a running application (A new build had just been deployed). When we stepped through the source the debugger would step completely over a line of code without executing it. When I ran ILDASM on the dll with show source lines the source line that was being missed out would be shown but no compiled code seemed to have been inserted into the dll. Below is a transcript of the ildasm output. The line 164 (in the VB source) where a call to Me.SelectAddParms seems to generate no il code at all. The il code for all the following vb source lines seems also to have been moved up to the line above.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_000e: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0013: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0018: ldc.i4.0
IL_0019: ble.s IL_0040
//000165: If Me.Select.Rows.Count > 0 Then
IL_001b: ldarg.0
IL_001c: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0021: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_0026: ldc.i4.0
IL_0027: callvirt instance class [System.Data]System.Data.DataRow [System.Data]System.Data.DataRowCollection::get_Item(int32)
IL_002c: ldstr "ContactID"
IL_0031: callvirt instance object [System.Data]System.Data.DataRow::get_Item(string)
IL_0036: call int32 [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType::FromObject(object)
IL_003b: stloc.0
IL_003c: br.s IL_0046
IL_003e: br.s IL_0045

Rebuilding this dll individually seemed to have no effect but the problem was resolved by building all of the dlls in the project, some of which this code uses. A transcript of the ILDASM output for the same section after the resolution is below. Four additional lines of il were produced. These lines are the call to the required method. No changes to the source code were made.

//000162: Me.ClearSelectParms()
IL_0001: ldarg.0
IL_0002: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::ClearSelectParms()
IL_0007: nop
//000163:
//000164: Me.SelectAddParms(FieldList.clsContactFieldList.NTLogon, sNTLogon)
IL_0008: ldarg.0
IL_0009: ldc.i4.s 16
IL_000b: ldarg.1
IL_000c: callvirt instance void [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::SelectAddParms(int32,
object)
IL_0011: nop
//000165: If Me.Select.Rows.Count > 0 Then
IL_0012: ldarg.0
IL_0013: callvirt instance class [System.Data]System.Data.DataTable [AIM2DataClasses]PI_BaseClasses.clsPIDBBaseExtension::Select()
IL_0018: callvirt instance class [System.Data]System.Data.DataRowCollection [System.Data]System.Data.DataTable::get_Rows()
IL_001d: callvirt instance int32 [System.Data]System.Data.InternalDataCollectionBase::get_Count()
IL_0022: ldc.i4.0
IL_0023: ble.s IL_004a

Many Thanks
Joe Simmonds
 
H

Herfried K. Wagner [MVP]

* "Joe Simmonds said:
I have just had a problem with some VB.net, I wonder if anybody can shed a little light and ease my confused brain.  The
problem is resolved now but I can't work out what happened and, more importantly, I can't guarantee it won't happen again. 
Have I misunderstood the situation?

Maybe there was a problem with the files in the "obj" folder, and
rebuilding the whole solution overwrote these files. Who knows...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top