Re: Cannot evaluate expression... optimized?
- From: Glenn <bagsmode@xxxxxxxxxxxxxxx>
- Date: Wed, 25 Apr 2007 17:20:46 GMT
On Tue, 24 Apr 2007 23:33:05 +0200, Göran Andersson <guffa@xxxxxxxxx>
wrote:
Glenn wrote:
On Tue, 24 Apr 2007 18:27:30 +0200, Göran Andersson <guffa@xxxxxxxxx>
wrote:
Glenn wrote:
OK, I've looked up this message but am not finding how to get rid ofWhen compiling in debug mode, the compiler adds extra nop (no operation)
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
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
.
- References:
- Cannot evaluate expression... optimized?
- From: Glenn
- Re: Cannot evaluate expression... optimized?
- From: Göran Andersson
- Re: Cannot evaluate expression... optimized?
- From: Glenn
- Re: Cannot evaluate expression... optimized?
- From: Göran Andersson
- Cannot evaluate expression... optimized?
- Prev by Date: C# Extending Excel
- Next by Date: Re: System.Diagnostics.StackTrace is wrong sometims
- Previous by thread: Re: Cannot evaluate expression... optimized?
- Next by thread: ExecuteScalar problem for null values
- Index(es):
Relevant Pages
|