Closed toebens closed 5 years ago
Can you please provide some sample code that reproduces the above?
It seems that a public const property within a behavior configuration class is causing these issues. I moved the constant properties to another class then the error is gone.
Hi, we upgraded our spec project's packages config to use the latest machine specification packages. We had upgraded from:
`
to: `
Skipped the packages we did not upgrade.
Now we are getting tons of messages when running the tests:
Fatal Error System.FieldAccessException: Cannot set a constant field. at System.Reflection.MdFieldInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) at Machine.Fakes.Sdk.ReflectionExtensions.<>c__DisplayClass7_0.<ResetReferences>b__1(FieldInfo x) at Machine.Fakes.Sdk.MissingFrameworkExtensions.Each[T](IEnumerable
1 enumerable, Action1 action) at System.Collections.Generic.List
1.ForEach(Action1 action) at Machine.Fakes.Internal.BehaviorConfigController.CleanUp(Object subject) at Machine.Fakes.WithFakes
2.<>c.<.ctor>b__1_0() `What's wrong? How can i identify where the problem might be? What is causing these exceptions?
Please note that we switched the project from net45 to net 471 some weeks back and hadn't had the problem. We did not update the packages. However i suppose it is some because of the new Machine.Fakes version. Thanks, toebens