Note that there are some explanatory texts on larger screens.

plurals
  1. POSecuring website assemblies with new code security model
    primarykey
    data
    text
    <p>I'm currently on a project where we are creating a <code>MVC site</code>. The site needs to use code access security, due to the fact that third party dll's needs to be plugged in, to provide custom functionality. Now we don't want these assemblies to have full trust, and therefore utilizing the new security model in <code>.NET 4.0</code></p> <p>Because of these requirements, we are stong naming all of our own assemblies, and installing them in the gac. Some of these assemblies are SecurityTransparent mixed with SecuritySafeCritical and SecurityCritical types and members. </p> <p>The securityTransparent and SecurityCritical assemblies, types and members can be used by the third party assembly developers just as we are intending.</p> <p>I now have this problem with the <code>Global.asax</code> file, which inherits from a class residing in a assembly marked with the <code>AllowPartiallyTrustedCallers</code> attribute. </p> <p>This class in turn inherits from <code>HttpApplication</code>.</p> <p>In my <code>web.config</code> the trustlevel is currently set to High.</p> <p>I'm getting the following error:</p> <blockquote> <p>Inheritance security rules violated by type: 'ASP.global_asax'. Derived types must either match the security accessibility of the base type or be less accessible</p> </blockquote> <p>I guess that's because of the inheritance rules when using the security model, and that the <code>HttpApplication</code> class must have a stricter rule than SecurityTransparent.</p> <p>I tried marking my custom class with the <code>SecuritySafeCritical</code> attribute, but with no luck.</p> <p>I hope some of you have a solution to this problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload