linkdemand

Understanding .NET's "SecurityAction" parameter for permissions

Can anyone explain the meaning of and purposes of the values for the SecurityAction enum? The MSDN page is not terribly clear. It says LinkDemand occurs at just-in-time compilation whereas Demand occurs at runtime. Why the distinction and in what situations would I use LinkDemand as opposed to Demand? Likewise, what are the use cases ...

How does .NET security really work?

I just saw this question: Understanding .NET’s “SecurityAction” parameter for permissions And I have a question. With the following code: private void button1_Click(object sender, EventArgs e) { Layer1(); MessageBox.Show("OK"); } private void Layer1() { try { Layer2(); } catch (SecurityException) {...

How do I appease FxCop when a property getter/setter needs LinkDemand?

I have a property Foo on a class Bar: public int Foo { get { return GetFoo(); } set { SetFoo(value); } } Both GetFoo and SetFoo are decorated with [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]. As a result, FxCop correctly complains that the Foo prop...

LinkDemand error on webserver when using TraceSource

Hi, On a webserver (shared hosting provider) I published a website with a ADO.Net Framework model in use with MySql Connector 6.3.1. When I request a page, a Security Exception will be happen with this error messages: "LinkDemand The type of the first permission that failed was: System.Security.Permissions.SecurityPermission The Zone o...

Understanding LinkDemand Security on a webserver

Hi, After deployment an ASP.Net application on a webserver, I get this error message by using code from a external assembly: "LinkDemand The type of the first permission that failed was: System.Security.PermissionSet The Zone of the assembly that failed was: MyComputer the error ". The assembly is include in the \bin folder and not in ...