Search code examples
asp.netweb-configcode-access-securitytrust

Where does a custom CAS policy for ASP.NET have to go?


In my hosting environment I do not have access to anything outside of my virtual directory-- I can't edit the machine.config, nor the machine level web.config, nor can I put anything in the GAC.

I reading up on Medium Trust. If I want, say, Medium Trust + one additional permission, can I create a custom trust level and put it in my virtual directory, or does this require an administrator's cooperation to manually edit machine wide config files?


Solution

  • From what I understand your virtual directory web config should be able to override the settings inherited from the machine.config file so you could create your custom trust policy within your web.config and have that enable the use of IO permissions.

    Trust Settings.
    http://msdn.microsoft.com/en-us/library/ff648344.aspx

    Config Heirarchy
    http://msdn.microsoft.com/en-us/library/ms178685.aspx