should I just set SuppressUnmanagedCodeSecurity for maximum performance?

Am I correct that if I need maximum performance, and I have trusted library I should just set SuppressUnmanagedCodeSecurity attribute to all Dll imports I have?

I.e. convert such import:

    [DllImport("srl.dll", CharSet = CharSet.Ansi)]
    private static extern string ErrorMsg(int ErrCode);

to such import:

    [DllImport("srl.dll", CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity]
    private static extern string ErrorMsg(int ErrCode);

everywhere.

Are there any reasons not to set SuppressUnmanagedCodeSecurity?

Answers


Need Your Help

Adding info windows to multiple circle overlays

javascript google-maps-api-3

I am having trouble adding an info window to each one of multiple circle overlays.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.