I have a VB.NET solution, just upgraded from 3.5 to 4.0. One of the classes has a private field:
Private _Projection As ICalculatedPath
At runtime, any time the class containing that field accesses that field, I get a FieldAccessException. The first time that field happens to get accessed is a null check in a method, and one of the things I randomly tried is changing the above line to:
Private _Projection As ICalculatedPath = Nothing
When I do this, I get the FieldAccessException on that line saying that the class's .ctor() cannot access that field. I've also tried making the field protected and public, clean/rebuild solution, restarting VS, targeting x86 and .NET 4.0 specifically on every project in the solution, and other non-sensical measures to get rid of this Exception but to no avail. This code worked fine before the upgrade, of course.
Maybe something went wrong in the upgrade process? I'm not really sure what to think here.