« Previous Next »

Answered Thread: Access Denied System.IdentityModel.Selectors

Last post 11-30-2009 4:40 PM by ianknight. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 10-29-2009, 7:36 AM

    • Tomoiaga
    • Not Ranked
    • Joined on 10-29-2009, 11:26 AM
    • Posts 3

    Access Denied System.IdentityModel.Selectors

    Hello Everyone,

    I am having some problems with a website I am trying to move from IIS6 to IIS7 (Plesk installed, it matters because this stupid panel does a lot of crap).
    To cut it short:

     

    [UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))]
    
    [FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
       System.Reflection.Assembly.Load(String assemblyString) +28
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
    
    [ConfigurationErrorsException: Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +57
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
       System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
       System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +600
       System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
       System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320
    
    [HttpException (0x80004005): Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
    
    [HttpException (0x80004005): Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8897659
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
    

     

    Looking with Procmon I only got one access denied error:

    1:30:50.4485137 PM w3wp.exe 5436 CreateFile C:\Windows\assembly\GAC_MSIL\System.IdentityModel.Selectors\3.0.0.0__b77a5c561934e089\System.IdentityModel.Selectors.dll ACCESS DENIED Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Delete, AllocationSize: n/a

    I have already setup the website manually and it works fine (it doesn't need the System.IdentityModel). Seems like only if I set it up from Plesk it requires that.
    Anyway, how can I grant access so that the creation of that dll can take place, and if it's ok ?

  • 11-04-2009, 5:28 AM In reply to

    Answered Re: Access Denied System.IdentityModel.Selectors

    To narrow down, try granting Users group with Read permission on C:\Windows\assembly and C:\WINDOWS\Microsoft.NET\Framework and apply to all their sub folders. Restart iis to see if this fixes the problem.

    WenJun Zhang - MSFT
    Sincerely
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 11-06-2009, 1:00 PM In reply to

    • Tomoiaga
    • Not Ranked
    • Joined on 10-29-2009, 11:26 AM
    • Posts 3

    Re: Access Denied System.IdentityModel.Selectors

    Hy,

    Thanks for the reply. I have set the AppPool to use ApplicationPoolIdentity and gived the Local\Users rights in the directory where the site is located and everything worked.
    So, looks like ApplicationPoolIdentity has rights in C:\Windows\assembly while the user that Plesk set for the apppool (by default belongs to IIS_IUSRS) does not.

    I have added the user used by Plesk to the Local\Users group but still no luck. Does AppPoolIdentity belong to an other group or has special permissions in C:\Windows\assembly ?
    I am reading about the new auth model in IIS 7.5 but can't seem to fully understand why with a normal user it does not work and with the AppPoolIdentity it does.

  • 11-06-2009, 2:04 PM In reply to

    • Tomoiaga
    • Not Ranked
    • Joined on 10-29-2009, 11:26 AM
    • Posts 3

    Re: Access Denied System.IdentityModel.Selectors

    Oh my, I am such an idiot.

    So, the IWPD_whatever that Plesk uses belongs to the psacln group. Than group had access denied on the dll and regardless if I added the IWPD user to the Users group it whoudn't change the access since denied rulez.

    Thanks for the suggestion, problem fixed :)

  • 11-30-2009, 4:40 PM In reply to

    Re: Access Denied System.IdentityModel.Selectors

     Could you give a step by step on how you fixed this - getting the same issue on plesk9 + win2008 + IIS7+Net3.5

Page 1 of 1 (5 items)
Microsoft Communities