PC Review


Reply
Thread Tools Rate Thread

Cannot evaluate expression... optimized?

 
 
Glenn
Guest
Posts: n/a
 
      24th Apr 2007
OK, I've looked up this message but am not finding how to get rid of
it: "Cannot evaluate expression because a thread is stopped at a point
where garbage collection is impossible, possibly because the code is
optimized"

I'm trying to debug, and it's rather difficult when I can't find the
values of expressions because of whatever is causing this message.

Is there anyone that can tell me what I can do to get rid of it? How
do I un-optimize the code, perhaps?

Any help appreciate, ty

Glenn
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      24th Apr 2007
Glenn wrote:
> OK, I've looked up this message but am not finding how to get rid of
> it: "Cannot evaluate expression because a thread is stopped at a point
> where garbage collection is impossible, possibly because the code is
> optimized"
>
> I'm trying to debug, and it's rather difficult when I can't find the
> values of expressions because of whatever is causing this message.
>
> Is there anyone that can tell me what I can do to get rid of it? How
> do I un-optimize the code, perhaps?
>
> Any help appreciate, ty
>
> Glenn


When compiling in debug mode, the compiler adds extra nop (no operation)
instructions in the code, so that there is an instruction in the code
for every possible break point. When compiling in release mode, these
extra instructions are not included, and some instructions may be
reorganised so that the final code does not exactly represent the flow
of the source code. If you stop the execution at a point in the code
that can not be matched to a position in the source code, you get this
error.

If you want the final code to exactly match the source code, you have to
compile it in debug mode. You should be aware, though, that some
operations are significantly slower in debug mode. Handling an exception
for example takes something like 100 times longer in debug mode.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Glenn
Guest
Posts: n/a
 
      24th Apr 2007
On Tue, 24 Apr 2007 18:27:30 +0200, Göran Andersson <(E-Mail Removed)>
wrote:

>Glenn wrote:
>> OK, I've looked up this message but am not finding how to get rid of
>> it: "Cannot evaluate expression because a thread is stopped at a point
>> where garbage collection is impossible, possibly because the code is
>> optimized"
>>
>> I'm trying to debug, and it's rather difficult when I can't find the
>> values of expressions because of whatever is causing this message.
>>
>> Is there anyone that can tell me what I can do to get rid of it? How
>> do I un-optimize the code, perhaps?
>>
>> Any help appreciate, ty
>>
>> Glenn

>
>When compiling in debug mode, the compiler adds extra nop (no operation)
>instructions in the code, so that there is an instruction in the code
>for every possible break point. When compiling in release mode, these
>extra instructions are not included, and some instructions may be
>reorganised so that the final code does not exactly represent the flow
>of the source code. If you stop the execution at a point in the code
>that can not be matched to a position in the source code, you get this
>error.
>
>If you want the final code to exactly match the source code, you have to
>compile it in debug mode. You should be aware, though, that some
>operations are significantly slower in debug mode. Handling an exception
>for example takes something like 100 times longer in debug mode.


Thank you for the reply...

I'm usually just using F5 or F6 to compile/debug.

What should I be doing differently to ensure that I'm compiling in
debug mode?

Thanks again
 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      24th Apr 2007
Glenn wrote:
> On Tue, 24 Apr 2007 18:27:30 +0200, Göran Andersson <(E-Mail Removed)>
> wrote:
>
>> Glenn wrote:
>>> OK, I've looked up this message but am not finding how to get rid of
>>> it: "Cannot evaluate expression because a thread is stopped at a point
>>> where garbage collection is impossible, possibly because the code is
>>> optimized"
>>>
>>> I'm trying to debug, and it's rather difficult when I can't find the
>>> values of expressions because of whatever is causing this message.
>>>
>>> Is there anyone that can tell me what I can do to get rid of it? How
>>> do I un-optimize the code, perhaps?
>>>
>>> Any help appreciate, ty
>>>
>>> Glenn

>> When compiling in debug mode, the compiler adds extra nop (no operation)
>> instructions in the code, so that there is an instruction in the code
>> for every possible break point. When compiling in release mode, these
>> extra instructions are not included, and some instructions may be
>> reorganised so that the final code does not exactly represent the flow
>> of the source code. If you stop the execution at a point in the code
>> that can not be matched to a position in the source code, you get this
>> error.
>>
>> If you want the final code to exactly match the source code, you have to
>> compile it in debug mode. You should be aware, though, that some
>> operations are significantly slower in debug mode. Handling an exception
>> for example takes something like 100 times longer in debug mode.

>
> Thank you for the reply...
>
> I'm usually just using F5 or F6 to compile/debug.
>
> What should I be doing differently to ensure that I'm compiling in
> debug mode?
>
> Thanks again


In the Build menu you will find Configuration Manager, that you can use
to select and edit the build configurations.

If you customize your toolbar, you can add the Solution Configurations
dropdown. It lets you see what the active setting is, and easily switch
between them.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Glenn
Guest
Posts: n/a
 
      25th Apr 2007
On Tue, 24 Apr 2007 23:33:05 +0200, Göran Andersson <(E-Mail Removed)>
wrote:

>Glenn wrote:
>> On Tue, 24 Apr 2007 18:27:30 +0200, Göran Andersson <(E-Mail Removed)>
>> wrote:
>>
>>> Glenn wrote:
>>>> OK, I've looked up this message but am not finding how to get rid of
>>>> it: "Cannot evaluate expression because a thread is stopped at a point
>>>> where garbage collection is impossible, possibly because the code is
>>>> optimized"
>>>>
>>>> I'm trying to debug, and it's rather difficult when I can't find the
>>>> values of expressions because of whatever is causing this message.
>>>>
>>>> Is there anyone that can tell me what I can do to get rid of it? How
>>>> do I un-optimize the code, perhaps?
>>>>
>>>> Any help appreciate, ty
>>>>
>>>> Glenn
>>> When compiling in debug mode, the compiler adds extra nop (no operation)
>>> instructions in the code, so that there is an instruction in the code
>>> for every possible break point. When compiling in release mode, these
>>> extra instructions are not included, and some instructions may be
>>> reorganised so that the final code does not exactly represent the flow
>>> of the source code. If you stop the execution at a point in the code
>>> that can not be matched to a position in the source code, you get this
>>> error.
>>>
>>> If you want the final code to exactly match the source code, you have to
>>> compile it in debug mode. You should be aware, though, that some
>>> operations are significantly slower in debug mode. Handling an exception
>>> for example takes something like 100 times longer in debug mode.

>>
>> Thank you for the reply...
>>
>> I'm usually just using F5 or F6 to compile/debug.
>>
>> What should I be doing differently to ensure that I'm compiling in
>> debug mode?
>>
>> Thanks again

>
>In the Build menu you will find Configuration Manager, that you can use
>to select and edit the build configurations.
>
>If you customize your toolbar, you can add the Solution Configurations
>dropdown. It lets you see what the active setting is, and easily switch
>between them.


OK, in the express version, it's not under Build... I had to go to
Solution Explorer, then open Properties. I found the check box for
"optimize code", so going to try that.

Thanks,
Glenn
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to evaluate expression because the code is optimized or native frame is on top of the call stack ED Microsoft Dot NET Compact Framework 3 11th Apr 2009 02:40 AM
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. Les Caudle Microsoft C# .NET 1 9th Dec 2008 10:24 AM
Cannot evaluate expression because the code of the current method is optimized. steevehetu18@hotmail.com Microsoft C# .NET 2 6th Sep 2006 02:08 AM
How to evaluate an expression EDom Microsoft ASP .NET 2 12th Aug 2005 08:41 PM
Evaluate Expression in while Bagger Vance Microsoft Dot NET 1 18th Feb 2005 01:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:37 AM.