Understanding LinkDemand Security on a webserver

Posted by robertpnl on Stack Overflow See other posts from Stack Overflow or by robertpnl
Published on 2010-05-03T11:30:02Z Indexed on 2010/05/03 11:38 UTC
Read the original article Hit count: 588

Filed under:
|
|
|

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 the GAC.

I try to know what linkdemand exactly is and why this message will raised. But looking for more information, I don't get exactly the problem.

I try also to add the PermissionSetAttribute on the class where the exception message happens:

 [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")]

Then the exception will be raised on another class of the assembly. And so on..

My questions ares: - what exactly is going wrong here? Is it true that I understand that .Net cannot check the code during Jit? - Is there maybe a security policy that block this (machine.config)? - Can I set the PermissionAttribute for all classes between a assembly?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#