curiouswebster
asked on
How can my static class become undefined??
I am running a C# project inside Visual Studio 2015, and have a strange problem where a static class becomes undefined??
Upon a Clean of my solution, the attached image proves the value Is Defined...
When I run the solution a second time, Constants Become UNdefined.
Any ideas how this is possible?
I am not running Code Optimization, I believe.
Thanks.
Upon a Clean of my solution, the attached image proves the value Is Defined...
When I run the solution a second time, Constants Become UNdefined.
Any ideas how this is possible?
I am not running Code Optimization, I believe.
Thanks.
ASKER
Yes, when I restart the app (F5) and I hit the breakpoint shown, the Constant static object is no longer defined. When I Clean before pressing F5, that breakpoint shows me Constant static object is visible in the Watch Window.
but what is the active line (the yellow one) on your first image?
ASKER
In both images, I hit the same breakpoint. In the first image, I have rested F10 and moved the cursor to the next line.
The point is that when I hovered over the value in the first image, the string value "lcckey" is visible in the floating text. So, the Constant static object is resolving.
In the second image, notice the Watch Window at the bottom, the same USER_LCC_KEY is undefined since Constant is also undefined.
The point is that when I hovered over the value in the first image, the string value "lcckey" is visible in the floating text. So, the Constant static object is resolving.
In the second image, notice the Watch Window at the bottom, the same USER_LCC_KEY is undefined since Constant is also undefined.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But it's a Static Class....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
You mean that you stop and you restart your application? All the memory containing variables (static or not) are released when you stop the application!