Is it possible to grant Full Trust to url within Medium Trust Web site

223 Views Asked by At

I'm using Dlls (Cells & PDF) from Aspose and ran into permission issue because the site must be set to Medium Trust while the DLLs requires Full Trust. I have attempted to different method to grant full trust to the DLLs while the site remains in Medium Trust. So far, I've tried the following: Created a separate custom medium trust config file with the code group for

<CodeGroup
   class="UnionCodeGroup"
       version="1"
       PermissionSetName="FullTrust"
       Name="Aspose.PDF_Asp.Net"
       Description="This code group grant full trust to Aspose.PDF">
       <IMembershipCondition
            class="StrongNameMembershipCondition"
            version="1"        
PublicKeyBlob="00240......."/>
</CodeGroup>

I've also tried adding to the web.config under the .Net Framework Config folder under the

<fullTrustAssemblies>
<add
   assemblyName="Aspose.Pdf"
   version="10.6.0.0"
   publicKey="00240000......"
/>

So far, none of these methods worked. So I'm wondering if it's possible to grant full trust to a specific page within the site without using a webservice. If I have a page that I can pass arguments and use that to run under Full Trust then I can mitigate at least this issue of Aspose not working under Medium Trust.

Thanks in advance.

1

There are 1 best solutions below

7
shakeel On

Please try installing the Aspose (Cells and PDF) assemblies in GAC (Global Assembly Cache). If I am not mistaken then installing any assembly in GAC grants it Full Trust permissions automatically and therefore it should resolve your issue.

Note: I am working as Developer Evangelist at Aspose