IIS website on shared folder and PolicyException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QW5kcmVhIEdhbGxhenpp?=

    IIS website on shared folder and PolicyException

    Hello,

    I have a website on a NAS.
    Permissions are set correctly because I can open HTML files.
    When framework is involved i receive this exception:
    System.Security .Policy.PolicyE xception: Required permissions cannot be
    acquired.
    It happens on file 'Microsoft.Appl icationBlocks.
    Trace below.

    I already tried to specify Full Trust in Webconfig.
    Do you have any idea?
    Thank you very much.

    Andrea

    Stack Trace:


    [PolicyException : Required permissions cannot be acquired.]
    System.Security .SecurityManage r.ResolvePolicy (Evidence evidence,
    PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    PermissionSet& denied, Boolean checkExecutionP ermission) +5343916
    System.Security .SecurityManage r.ResolvePolicy (Evidence evidence,
    PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
    PermissionSet& denied, Int32& securitySpecial Flags, Boolean
    checkExecutionP ermission) +115

    [FileLoadExcepti on: Could not load file or assembly
    'Microsoft.Appl icationBlocks.E xceptionManagem ent, Version=1.0.0.0 ,
    Culture=neutral , PublicKeyToken= null' or one of its dependencies. Failed to
    grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
    System.Reflecti on.Assembly._nL oad(AssemblyNam e fileName, String codeBase,
    Evidence assemblySecurit y, Assembly locationHint, StackCrawlMark& stackMark,
    Boolean throwOnFileNotF ound, Boolean forIntrospectio n) +0
    System.Reflecti on.Assembly.Int ernalLoad(Assem blyName assemblyRef,
    Evidence assemblySecurit y, StackCrawlMark& stackMark, Boolean
    forIntrospectio n) +465
    System.Reflecti on.Assembly.Int ernalLoad(Strin g assemblyString, Evidence
    assemblySecurit y, StackCrawlMark& stackMark, Boolean forIntrospectio n) +181
    System.Reflecti on.Assembly.Loa d(String assemblyString) +42
    System.Web.Conf iguration.Compi lationSection.L oadAssemblyHelp er(String
    assemblyName, Boolean starDirective) +190

    [ConfigurationEr rorsException: Could not load file or assembly
    'Microsoft.Appl icationBlocks.E xceptionManagem ent, Version=1.0.0.0 ,
    Culture=neutral , PublicKeyToken= null' or one of its dependencies. Failed to
    grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
    System.Web.Conf iguration.Compi lationSection.L oadAssemblyHelp er(String
    assemblyName, Boolean starDirective) +3642024

    System.Web.Conf iguration.Compi lationSection.L oadAllAssemblie sFromAppDomainB inDirectory() +402
    System.Web.Conf iguration.Compi lationSection.L oadAssembly(Ass emblyInfo ai)
    +155
    System.Web.Conf iguration.Assem blyInfo.get_Ass emblyInternal() +36

    System.Web.Comp ilation.BuildMa nager.GetRefere ncedAssemblies( CompilationSect ion compConfig) +235
    System.Web.Comp ilation.BuildPr ovidersCompiler ..ctor(VirtualP ath
    configPath, Boolean supportLocaliza tion, String outputAssemblyN ame) +76

    System.Web.Comp ilation.CodeDir ectoryCompiler. GetCodeDirector yAssembly(Virtu alPath
    virtualDir, CodeDirectoryTy pe dirType, String assemblyName, StringSet
    excludedSubdire ctories, Boolean isDirectoryAllo wed) +2944151
    System.Web.Comp ilation.BuildMa nager.CompileCo deDirectory(Vir tualPath
    virtualDir, CodeDirectoryTy pe dirType, String assemblyName, StringSet
    excludedSubdire ctories) +204
    System.Web.Comp ilation.BuildMa nager.EnsureTop LevelFilesCompi led() +613

    [HttpException (0x80004005): Could not load file or assembly
    'Microsoft.Appl icationBlocks.E xceptionManagem ent, Version=1.0.0.0 ,
    Culture=neutral , PublicKeyToken= null' or one of its dependencies. Failed to
    grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
    System.Web.Comp ilation.BuildMa nager.ReportTop LevelCompilatio nException()
    +79
    System.Web.Comp ilation.BuildMa nager.EnsureTop LevelFilesCompi led() +2943544
    System.Web.Host ing.HostingEnvi ronment.Initial ize(Application Manager
    appManager, IApplicationHos t appHost, IConfigMapPathF actory
    configMapPathFa ctory, HostingEnvironm entParameters hostingParamete rs) +1163

    [HttpException (0x80004005): Could not load file or assembly
    'Microsoft.Appl icationBlocks.E xceptionManagem ent, Version=1.0.0.0 ,
    Culture=neutral , PublicKeyToken= null' or one of its dependencies. Failed to
    grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
    System.Web.Http Runtime.FirstRe questInit(HttpC ontext context) +2739623
    System.Web.Http Runtime.EnsureF irstRequestInit (HttpContext context) +88
    System.Web.Http Runtime.Process RequestInternal (HttpWorkerRequ est wr)
    +2739533
  • =?Utf-8?B?QW5kcmVhIEdhbGxhenpp?=

    #2
    RE: IIS website on shared folder and PolicyException

    This seems to be really usefull.

    I will let you know if it works.

    Comment

    • =?Utf-8?B?QW5kcmVhIEdhbGxhenpp?=

      #3
      RE: IIS website on shared folder and PolicyException

      It works for me.
      Wonderful article.

      Comment

      Working...