S
Saga
So I am stepping through my program and I either hover
or select an expression and hit F9 and its value is displayed,
but then in some cases I get this message:
"Cannot evaluate expression because we are stopped in a
place where garbage collection is impossible, possibly because
the code of the current method may be optimized."
I searched for it and got various hits, some of them useful,
but not enough to solve my problem. I have never encountered
this message before. The only difference for this specific routine
is that I copied and pasted it from a VB6 project. Initially it had
lots of errors (102 to be exact), but I changed the code accordingly
and got it down to 0 errors.
For example, I get the message on this line:
begin.dteBegDate = DateSerial(CInt(strAr(2).Substring(strAr(2).Length() - 2,
2)), _
CInt(strAr(2).Substring(0, 2)),
CInt(strAr(2).Substring(2, 2)))
Where strAr(2) is "042710". If I highlight any of the following line and hit
F9 I get
the message:
strAr(2).Substring(strAr(2).Length() - 2, 2)
or
cint(strAr(2).Substring(strAr(2).Length() - 2, 2))
or
BData.dteBegDate
But if I highlight the following line I get the value correctly:
BData.strVehicleId = strAr(4).Trim()
BData is a structure. I already checked the JIT suppress option as
recommended
by the information that I found, but this does not seem to be the issue. I
suspect
that some of my .NET code may not be up to spec. Any suggestions are
welcomed.
Thank you, Saga
or select an expression and hit F9 and its value is displayed,
but then in some cases I get this message:
"Cannot evaluate expression because we are stopped in a
place where garbage collection is impossible, possibly because
the code of the current method may be optimized."
I searched for it and got various hits, some of them useful,
but not enough to solve my problem. I have never encountered
this message before. The only difference for this specific routine
is that I copied and pasted it from a VB6 project. Initially it had
lots of errors (102 to be exact), but I changed the code accordingly
and got it down to 0 errors.
For example, I get the message on this line:
begin.dteBegDate = DateSerial(CInt(strAr(2).Substring(strAr(2).Length() - 2,
2)), _
CInt(strAr(2).Substring(0, 2)),
CInt(strAr(2).Substring(2, 2)))
Where strAr(2) is "042710". If I highlight any of the following line and hit
F9 I get
the message:
strAr(2).Substring(strAr(2).Length() - 2, 2)
or
cint(strAr(2).Substring(strAr(2).Length() - 2, 2))
or
BData.dteBegDate
But if I highlight the following line I get the value correctly:
BData.strVehicleId = strAr(4).Trim()
BData is a structure. I already checked the JIT suppress option as
recommended
by the information that I found, but this does not seem to be the issue. I
suspect
that some of my .NET code may not be up to spec. Any suggestions are
welcomed.
Thank you, Saga