How to use SecurityPermissionAttribute correctly?

In an old project, I came across the following build attribute:

[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum, Execution = true)]

I understand that this attribute instructs clr not to load this dll if the required permissions are not available. Is it good practice to include such ads in your project by default?

+3
source share
1 answer

RequestMinimumnever enjoyed great popularity. In fact, most of the code access security model has never been heavily loaded. Consequently, these areas have been heavily redesigned for .NET 4.0.

Starting with .NET 4.0, do not use RequestMinimum, because it will be ignored.

.NET 4.0, http://msdn.microsoft.com/en-us/library/dd233103(VS.100).aspx.

+4

Source: https://habr.com/ru/post/1732559/


All Articles