debug
-
Hi All public void sample(string s) { string k = s+"test"; return k; } This is my function in App_code/Test.cs I want to give one vale like sample(ram) and test whether it returns correct value. I know about the breakpoint ... I want to know whether in immediate window or in watch window ,is it possible to check the value ....so that it will be helpfull for me while coding Thanks
Ramkumar
-
Hi All public void sample(string s) { string k = s+"test"; return k; } This is my function in App_code/Test.cs I want to give one vale like sample(ram) and test whether it returns correct value. I know about the breakpoint ... I want to know whether in immediate window or in watch window ,is it possible to check the value ....so that it will be helpfull for me while coding Thanks
Ramkumar
Use the following code in the Immediate Window -
?sample("test")
You might need to append the class name infront of the method. You can get the details here[^].
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
-
Use the following code in the Immediate Window -
?sample("test")
You might need to append the class name infront of the method. You can get the details here[^].
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
Thanks ...but i am getting this error..remember i am coding in class file The expression cannot be evaluated while in design mode. ?sample("fsdf") The expression cannot be evaluated while in run mode. Please help
Ramkumar
-
Thanks ...but i am getting this error..remember i am coding in class file The expression cannot be evaluated while in design mode. ?sample("fsdf") The expression cannot be evaluated while in run mode. Please help
Ramkumar
getramonweb wrote:
The expression cannot be evaluated while in design mode. ?sample("fsdf") The expression cannot be evaluated while in run mode.
I created the following class with your method (your sample method would give compilation error) -
namespace MyNameSpace
{
public class MyClass
{
public static string sample(string s)
{
string k = s + "test";
return k;
}}
}
Then I used the following commands in the immediate window to get the result (check that I used static method) -
?MyNameSpace.MyClass.sample("Arindam");
I think you need to read this[^] carefully. Mainly go through the multiple project section as you have to select the project as startup project. Also this link tells about some limitations.
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
-
getramonweb wrote:
The expression cannot be evaluated while in design mode. ?sample("fsdf") The expression cannot be evaluated while in run mode.
I created the following class with your method (your sample method would give compilation error) -
namespace MyNameSpace
{
public class MyClass
{
public static string sample(string s)
{
string k = s + "test";
return k;
}}
}
Then I used the following commands in the immediate window to get the result (check that I used static method) -
?MyNameSpace.MyClass.sample("Arindam");
I think you need to read this[^] carefully. Mainly go through the multiple project section as you have to select the project as startup project. Also this link tells about some limitations.
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.
thanks,, sorry for disturbing again and again I just copy past the code ,but i got same error...can u plz guid me where i am going wrong ?MyNameSpace.MyClass.sample("Arindam"); The expression cannot be evaluated while in design mode.
Ramkumar
-
thanks,, sorry for disturbing again and again I just copy past the code ,but i got same error...can u plz guid me where i am going wrong ?MyNameSpace.MyClass.sample("Arindam"); The expression cannot be evaluated while in design mode.
Ramkumar
You are not disturbing anyone :) It's my pleasure to solve (if any :laugh: ) issues. Did you select the project as startup project where you place this MyClass? I have quoted the section from the MSDN[^] Design Time Expression Evaluation in Multi-Project Solutions When establishing the context for design time expression evaluation, Visual Studio references the currently selected project in Solution Explorer. If no project is selected in Solution Explorer, Visual Studio attempts to evaluate the function against the startup project. If the function cannot be evaluated in the current context, you will receive an error message. If you are attempting to evaluate a function in a project that is not the startup project for the solution and you receive an error, try selecting the project in Solution Explorer and attempt the evaluation again.
Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.