Error Cannot Obtain Value
Contents |
Visual Studio Diagnostics (Debugger, Profiler, IntelliTrace) Question 0 Sign in to vote hello I have a problem while debugging in visual studio 2005 i have a class with an enumerator member in it, and while debugging when i want cannot obtain value of local or argument optimized away to see the value of the enumerator I get the error "error: cannot obtain value" visual studio 2015 cannot obtain value is there any way to see the enumerator value? Thursday, February 22, 2007 9:53 AM Reply | Quote Answers 0 Sign in to complus_zapdisable=1 vote I believe this to be a bug in the managed C++ expression evaluator.A workaround would be to enter the full expression for the sub item into the watch window, like so:MyTest.mBool Marked as answer by rchiodo -
Cannot Obtain Value Of The Local Variable Or Argument Because It Is Not Available
MSFTModerator Friday, November 13, 2009 11:45 PM Friday, November 13, 2009 11:45 PM Reply | Quote Moderator All replies 0 Sign in to vote I am seeing the same problem using Visual C++ 2008 with the following versions: Microsoft Visual Studio 2008 Version 9.0.21022.8 RTM Microsoft .NET Framework Version 3.5 SP1 The problem is easily reproducible by creating an empty CLR project, and creating a CPP file with the following code: enum UnmanagedBool { Bool_False, Bool_True }; struct UnmanagedStruct the value of the local or argument is unobtainable at this time { UnmanagedStruct() : mBool( UnmanagedBool::Bool_False ) { } UnmanagedBool mBool; }; int main() { UnmanagedStruct MyTest; return 0; } If you set a breakpoint on the last line of the main function, you'll see that the debugger shows "error: cannot obtain value" for the value of mBool. Interestingly, if you right click on mBool and select 'Add Watch' you'll be able to see the value for it. When you then go back to viewing the local variable MyTest, it will show a green refresh symbol next to the value of mBool. Clicking this will then show the correct value. Changing UnmanagedStruct to a managed struct by adding the ref keyword allows you to see the numerical value for the enumeration type. Unfortunately in my main application this isn't possible, so I really need a fix for this. Wednesday, November 11, 2009 12:19 AM Reply | Quote 0 Sign in to vote I believe this to be a bug in the managed C++ expression evaluator.A workaround would be to enter the full expression for the sub item into the watch window, like so:MyTest.mBool Marked as answer by rchiodo - MSFTModerator Friday, November 13, 2009 11:45 PM Friday, November 13, 2009 11:45 PM Reply | Quote Moderator Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey wi
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/State Management/Session = error: cannot obtain value Session = error: cannot obtain value RSS 5 replies Last cannot evaluate the expression because the code of the current method is optimized post Apr 03, 2009 07:39 AM by svibuk ‹ Previous Thread|Next Thread
Visual Studio Disable Optimization
› Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply
Visual Studio 2015 Turn Off Optimization
svibuk Member 151 Points 1921 Posts Session = error: cannot obtain value Apr 03, 2009 05:43 AM|svibuk|LINK i have the folowing code USERNAME ="test" Session("S_USERNAME") = USERNAME
but when i https://social.msdn.microsoft.com/Forums/vstudio/en-US/558ee4d5-3f16-4dff-a231-e6f8301df7a2/cannot-obtain-value-error-message?forum=vsdebug debug for USERNAME i get test but when i go on Session("S_USERNAME") i get Session = error: cannot obtain value. whts the problem Reply vinayuthappa Member 199 Points 151 Posts Re: Session = error: cannot obtain value Apr 03, 2009 07:08 AM|vinayuthappa|LINK Hi, to insert into a session use, Session["SESSION1"] = userName; here the userName http://forums.asp.net/t/1405979.aspx?Session+error+cannot+obtain+value is stored in the session named SESSION1. To retrieve the value from session use, string UserName = (string)Session["SESSION1"]; here the username that is stored in the session is retrieved into a string named UserName Uthappa T.P C# .Net Visual Studio 2008 Reply qwe123kids All-Star 32871 Points 7895 Posts Re: Session = error: cannot obtain value Apr 03, 2009 07:10 AM|qwe123kids|LINK Hi, /* Session("S_USERNAME") */ use Convert.tostring(Session("S_USERNAME")) or Session("S_USERNAME").tostring() Thanks Avinash Tiwari Remember to click “Mark as Answer” on the post, if it helps you. Reply svibuk Member 151 Points 1921 Posts Re: Session = error: cannot obtain value Apr 03, 2009 07:17 AM|svibuk|LINK if u use .tostring() i get msg expression is a value and therefore cannot be the target of an assignment as i am using vb.net as code behind i need to use ( instead of [ for session Reply jeeth Member 70 Points 12 Posts Re: Session = error: cannot obtain value Apr 03, 2009 07:33 AM|jeeth|LINK I think you are using .ToString() while assigning to the session, you should use it whiobtain value' on any variable (DataSet in my case) even when the information is passed correctly from the DataTier into the DataSet. What was interesting about this error is that it never happened http://www.zubairahmed.net/?p=85 to any other DataSet in the same class. After googling for the problem, I http://www.vbforums.com/showthread.php?585708-RESOLVED-Error-cannot-obtain-value-in-Watch found out that following the insertion to the DataSet, my class had a call to a function with apparently more parameters than VS Debugger can handle and therefore the error. This looks like an issue with the Debugger that requires attention of our friends at MS. « Too many things, Too little time Cache Access cannot obtain Pattern and updating it frequently » Software Developer. Blogger. Speaker Subscribe to RSS feed Follow @zubairdotnet Zubair Ahmed on Twitter Counter Search for: Archives Select Month March 2015 (1) November 2014 (1) June 2014 (1) January 2014 (1) December 2013 (2) September 2013 (3) July 2013 (3) May 2013 (1) April 2013 (1) January 2013 (1) November 2012 (1) September 2012 (2) August 2012 (1) July 2012 (1) cannot obtain value June 2012 (1) May 2012 (1) April 2012 (3) March 2012 (3) October 2011 (1) September 2011 (1) July 2011 (1) June 2011 (1) May 2011 (1) April 2011 (1) February 2011 (1) September 2010 (2) July 2010 (4) June 2010 (1) May 2010 (1) January 2010 (1) November 2009 (2) October 2009 (2) August 2009 (2) July 2009 (1) May 2009 (2) April 2009 (2) December 2008 (1) November 2008 (2) June 2008 (4) May 2008 (2) April 2008 (4) February 2008 (1) January 2008 (1) December 2007 (2) November 2007 (3) October 2007 (1) July 2007 (3) June 2007 (2) May 2007 (3) April 2007 (4) March 2007 (2) September 2006 (1) August 2006 (2) July 2006 (3) June 2006 (1) May 2006 (3) April 2006 (2) March 2006 (3) February 2006 (1) January 2006 (2) December 2005 (3) November 2005 (4) October 2005 (3) September 2005 (7) August 2005 (5) July 2005 (1) June 2005 (9) May 2005 (13) April 2005 (1) January 2005 (2) Categories Select Category .ne(1) .NET 2.0(1) .NET 3.5(4) .NET 4.0(6) .NET 4.5(15) .NET Framework(11) .NET Micro Framework(1) ADO.NET(1) Agent SmartWatch(1) Agile(1) AOP(1) AppFabric(2) Architecture(2) ASP.NET(13) ASP.NET 4.5(2) ASP.NET AJAX(2) ASP.NET Charts(1) asp.NETPro(1) Async(2) automation(1) batches(1) Bing Map(1)
value in Watch If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 8 of 8 Thread: [RESOLVED] Error: cannot obtain value in Watch Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Sep 28th, 2009,01:10 AM #1 scsfdev View Profile View Forum Posts Visit Homepage Thread Starter Addicted Member Join Date Feb 2008 Location Singapore Posts 224 [RESOLVED] Error: cannot obtain value in Watch Hi all, I'm facing a strange problem in VS.Net 2003 Debugger mode. I'm testing a window application which was written in VB.Net 2003. I set a few BreakPoints and Debug the project. When the debugger hit one of the breakpoints, it stops at there. Its correct. But when I try to add one of the variables to "Watch", it said "error: cannot obtain value". I tried to search the Net and found that some said "its because of structures", some said "its because of passing too many parameters." and some said "its because of too many line of codes (LOCs)". but my problem is not in passing parameters or too many line of code. the function i set breakpoint has only around 300 LOCs (including around 100 line of comments) And the value I tried to get is from my TreeView which is on my Win Forms. its very strange that I can't even get the value from Forms. I assign this TreeView value to another TreeView (this one is declare in code.) And this second TreeView also can't view Watch. What can I do for that? Any suggestions or any fixes? I'm using Visual Studio 2003 in VB.Net with SQL Server 2000 for the above project. Thanks. I'm using VS 2005 & 2008 & 2010 with SQL Server 2005 Exp