Bug 10832 - ForceLoadType() resets static field values
Summary: ForceLoadType() resets static field values
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 4.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2013-03-01 18:14 UTC by Jeffrey Stedfast
Modified: 2013-03-01 19:46 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Test.zip (7.94 KB, application/zip)
2013-03-01 18:14 UTC, Jeffrey Stedfast

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeffrey Stedfast 2013-03-01 18:14:58 UTC
Created attachment 3524 [details]

If you try to evaluate a static field on a class after a value has been assigned to it, it will evaluate to the initial value because FieldValueReference.get_Value() will ForceLoad() the type (which invokes the .cctor), reinitializing all of the fields before fetching the field value.
Comment 1 Jeffrey Stedfast 2013-03-01 19:46:42 UTC
fixed in git master