System.MethodAccessException, CAS and Visual Studio debugger
问题 I am calling ModelMetadataProviders.Current.GetMetadataForProperties to fetch list of ModelMetadata in WPF application with Visual Studio 2010. This call executes fine and I get IEnumerable<> in return. At the code line, where I try to iterate over this, I get System.MethodAccessException. Funny thing is it happens only if I am debugging with F5. If I run code with Ctrl+F5, then I do NOT get this exception and code works fine. If I run exe from windows explorer, it runs fine as well. Surely,