none
what is permissionset reqmin ? RRS feed

  • Question

  •  
    Hi All,
     
    I have a DLL which when used in my ASP.Net Hosting in the BIN Directory (Godaddy - which supports Medium Trust), works fine.   -> Original DLL
    The same DLL, I Dis-assembled to .cs files and recompiled/build  it (no change to the code).     -> reCompiled DLL ( tried in both Debug Version & Release  )
     
    Both the DLL are targetted for .Net 2.0 & no extra assemblyInfo was added either.
     
    But the reCompiled DLL  (instead of  Original DLL)  when used in the same ASP.Net application in the BIN directory  throwed an error shown below :
     

    [PolicyException: Required permissions cannot be acquired.] 
    System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2770052
    System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
    whole of the error page is here...(err.html)
     
    Later I found that  Metadata  of   reCompiled DLL adds  the below info automatically.
     

    .permissionset reqmin

    = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}}

     

     

    http://forums.subsonicproject.com/forums/t/1250.aspx  From this, I tried adding [assembly: System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.RequestMinimum,SkipVerification =false) ] to the AssemblyInfo

    didnt work.

     
     
    Is this .permissionset reqmin  the  real culprit? Is there a way to remove .permissionset reqmin detail from the reCompiled DLL. Also the Original DLL is not having   .permissionset reqmin attribute Metadata.
    And this is the only difference in the Metadata of the 2 DLLs.
     
     
     
     
     
      Thanks in advance!!
    Thursday, January 22, 2009 5:30 PM

Answers

  • Compiling with the /unsafe option ("Allow unsafe code" in VS) will add that requirement. I'm guessing that's the cause, so try turning that option off if you don't need it.

     


    Mattias, C# MVP
    Friday, January 23, 2009 8:16 AM
    Moderator