Have you ever received an exception like this:
This exception is thrown whenever you try to access a protected resource while your code doesn’t have the required permissions.
.NET Framework helps protecting computer system from malicious code and software by using a nice feature of CLR called Code Access Security (simply, CAS.) This feature manages the permissions gained by .NET applications, allows code from known vendors and code running from secure locations to run seemlessly without interruption of the CLR, while holds other applications from unknown vendors and applications running fromÂ insecureÂ locations (like network shares) to run with restrictions and limitation of access to shared system resources.
A great job from the author is done in the following article: