How do I reference a namespace to be used in immediate or quickwatch?

In my understanding the QuickWatch and the Immediate windows are executing the code / expressions under the current executing context, so once there is a using System; in place in the code, the quickwatch window will not give any issue. You may have encountered some visual studio bug. Try restarting VisualStudio and check again. I … Read more

Immediate Window, “The expression cannot be evaluated….”

Assuming that you aren’t missing the > operator in the Immediate Window, there could be problems if you are trying to evaluate an expression at design-time in a multi-project solution or even a web project. According to MSDN: If you are attempting to evaluate a function in a project that is not the startup project … Read more

Visual Studio Immediate Window – Lambda Expressions Aren’t Allowed – Is there a Work-around or Alternative? [closed]

At times like this I always turn to the most excellent LINQPad. The front page of the linked site (at time of writing) immediately jumps in with stuff about SQL but don’t let that obscure how powerful and flexible this tool really is. I sort of treat it like an Immediate Window on steroids. I … Read more

Newlines in the Immediate Window

Actually there is a way. You can use format specifiers in the immediate window to change the format of the display. If you have a string with carriage returns and linefeeds in it (“\r\n”) you can follow the print request with the ‘no quotes’ format specifier. In the immediate window type: ?MyObj.ToString(),nq and the \r\n … Read more

Dynamic in the immediate window causes ‘Microsoft.CSharp.RuntimeBinder.Binder’ is not defined or imported error

You should add reference to Microsoft.CSharp library in the selected project or in the startup project. And your project should reference .NET Framework 4 or higher. MSDN about immediate window context: When establishing the context for design time expression evaluation, Visual Studio references the currently selected project in Solution Explorer. If no project is selected … Read more

Visual Studio Immediate window: how to see more than the first 100 items

Sometimes its useful to see the list in the immediate window rather than looking in the watch window. You can easily see more results than the first 100 by using: yourList.Skip(100).ToArray() Which really doesn’t take long to write and works well – was useful for me. Update: As pointed out in the comments below, this … Read more

Visual Studio immediate window command for Clear All

To clear the immediate window, you can use >cls, which is a predefined command alias to >Edit.ClearAll. The MSDN article lists all predefined aliases and you can define your own, too. (For VS 2010 and earlier, custom aliases are described in a separate article, though.) Scanning through, there’s a whole slew of them, some of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)