How to tell wether Code Access Security is allowed in library code
- by Sander Rijken
in .NET 4 Code Access Security (CAS) is deprecated. Whenever you call a method that implicitly uses it, it fails with a NotSupportedException, that can be resolved with a configuration switch that makes it fall back to the old behavior.
We have a common library that's used in both .NET 3.5 and .NET 4, so we need to be able to tell wether or not we…