Jump to content
Xtreme .Net Talk

Immediate Window "Unable to Evaluate the Expression"


Recommended Posts

Posted

If I interrupt debugging by clicking the "Break All" (") toolbar button, I can't evaluate any expressions in the Immediate Window. I get the message "Unable to Evaluate the Expression" whenever I try. But if I call the Stop statement in code, then I can. So I end up putting code in my form like:

 

   Private Sub picCanvas_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles picCanvas.DoubleClick

       If System.Diagnostics.Debugger.IsAttached Then Stop

   End Sub

so that I can access the Immediate Window and query values. Is this right that I have to do this?

  • Administrators
Posted
Why don't you just put a break point on the line(s) you want to cause the app to break at? Doing a Break All will often result in the application being put into debug mode but outside of any actual runable .Net code - that is why you cannot evaluate any expressions etc.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Why don't you just put a break point on the line(s) you want to cause the app to break at? Doing a Break All will often result in the application being put into debug mode but outside of any actual runable .Net code - that is why you cannot evaluate any expressions etc.

 

Because sometimes I don't have a particular point at which I want execution to stop. I'm running it and I just want to go into it to query some value.

 

I don't know about the application breaking outside any runnable code - it can't even evaluate "? 7 + 3" for me, which I wouldn't think requires any runnable code. But anyway I can live with my suggestion above.

Posted
? 7 + 3 worked just fine for me when I hit CTRL + BREAK...

Yes, it seems that if you hit CTRL + BREAK when the current form in the application has focus it works OK, but if you break by pressing the button in the toolbar or by hitting CTRL + BREAK while looking at the code, it doesn't work.

  • Leaders
Posted
I tried pausing from the IDE and it worked fine for me. Is the code editor highlighting a line of code when you break (a "call return", it will be a different color than active line and have an arrow in the breakpoint margin)?
[sIGPIC]e[/sIGPIC]
Posted
I tried pausing from the IDE and it worked fine for me. Is the code editor highlighting a line of code when you break (a "call return"' date=' it will be a different color than active line and have an arrow in the breakpoint margin)?[/quote']

No, the same thing happens even if run a newly created project to which I've added no code. It's probably a bug. I have 2005 Express Edition.

  • Leaders
Posted
Here is a question: are you using VB with the application framework enabled (it is under Project/Properties in the menu)? For some reason, I think that this might have something to do with it.
[sIGPIC]e[/sIGPIC]
Posted
Here is a question: are you using VB with the application framework enabled (it is under Project/Properties in the menu)? For some reason' date=' I think that this might have something to do with it.[/quote']

Yes I am, and you're right, when I deselect that it works OK. So I suppose that's my choice - either I turn that off or I continue dealing with this as I have been doing before.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...