Webservice: "The ASP.NET process identity does not have read permissions to the global assembly cache."

I'm uncertain what the best forum is for this - I also posted this in the ASP forum.

I am developing a distributed application with a client-side java calling a webservice serving a static binary database. The application works well with the VS2005 Development server on XP Pro SP2.

However when I publish it to an IIS v5 environment, it fails with these errors.
 

3.)    .aspnet_wp.exe (PID: 3988) stopped unexpectedly



2.)  Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache. Error: 0x80131902

1.)

Failed to initialize the AppDomain:/LM/W3SVC/1/Root

Exception: System.Configuration.ConfigurationErrorsException

Message: Exception of type 'System.Configuration.ConfigurationErrorsException' was thrown.

StackTrace: at System.Web.Configuration.ErrorRuntimeConfig.ErrorConfigRecord.System.Configuration.Internal.IInternalConfigRecord.GetLkgSection(String configKey)

at System.Web.Configuration.RuntimeConfigLKG.GetSectionObject(String sectionName)

at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)

at System.Web.Configuration.RuntimeConfig.get_HostingEnvironment()

at System.Web.Hosting.HostingEnvironment.StartMonitoringForIdleTimeout()

at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)

at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)

at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)

at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)


This service runs fine with no problems on the vs2005 local host development server.  I may be attempting to read a file in the IIS environment and I don't think I am going to know until I get the general assembly cache with gacutil.exe


I think the important error, is error 2. I think gacutil.exe is the utility I need unless permissions are just off on the directory.

Lest I ramble on.... what do  I do to fix this I forgot to mention that this came from the event viewer. I'll look anywhere for data on what's going on. Generally... there's a clue, somewhere! :)

Renee




Answer this question

Webservice: "The ASP.NET process identity does not have read permissions to the global assembly cache."

  • Feldhege

    Try reinstalling ASP.NET on your box using the Administration utility (2.0.50727) to install and uninstall ASP.NET on the local machine.:

    1. Open a command prompt
    2. Stop IIS: iisreset /stop
    3. Change to the .NET Framework 2.0 root directory: C:\winnt\Microsoft.Net\Framework\v2.0.50727\
    4. Reinstall ASP.NET 2.0 by using the following command: aspnet_regiis -i command.
    5. Start IIS again after it has been run: iisreset /start

    Try to access your web page again.



  • Robert Seiler

    Hi, I have the same problem. But I have user /ASPNET correctly created and it has modify access over all inetpub/wwwroot directory (folder). I cannot reinstall, because there is over hundred another webs on the server and server has contracted high reliability :(

     



  • Al Edwards

     Phil Grigg wrote:

    Check out this link - has all the possible solutions. Great PDF!

    I'll second that. It's a nice concise guide to troubleshooting ASP.NET 2.0 & IIS installation issues.



  • Nemo Wang

    Thank you, r sτσρhΞr Sc δlτξη ,
    I
    have solved my problem with your instruction!


  • Jeffrey Becker


    This has been resolved!!!!

    The problem is quasi-environmental. During the development of this project there were several power failures and when the power returned there was no communication with the web....

    Because of the error messages it appeared perhaps that IIS itself was corrupted in the XP Pro SP2 system. IIS was uninstalled and reinstalled. But IIS was not the problem. Actually a router had died.

    What I did find out were several things. If IIS is ever uninstalled, in relation to ASP at a minimimum a full de-installtion of VS2005 and IIS is required.

    Then a resinstallation FIRST of IIS followed by VS2005.

    I didn't have any luck with this. Actually I had to reinstall my entire XP system and reinstall everything and now the original code is working.



  • grambo

    Glad to be of service!

  • Dr.B.

    Christopher, thank you very much! that fixed my problem!
  • israfel

    I was also getting this message. Chronologically, in the Event log, there are always two messages, first:

    Event Type: Error
    Event Source: ASP.NET 2.0.50727.0
    Event Category: None
    Event ID: 1000
    Date: 16/01/2006
    Time: 10:09:55 PM
    User: N/A
    Computer: ABCDEF
    Description:
    aspnet_wp.exe (PID: 4560) stopped unexpectedly.

    followed by a:

    Event Type: Error
    Event Source: ASP.NET 2.0.50727.0
    Event Category: None
    Event ID: 1089
    Date: 16/01/2006
    Time: 10:09:55 PM
    User: N/A
    Computer: ABCDEF
    Description:
    Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache. Error: 0x80070005 Access is denied.

    This happened even when I create a web site from scratch on my development machine, with just the basic site template, and add the following code in the Page_Load method, put a breakpoint on it, and execute:

    Debug.Write("test");

    I get a dialog with HTML on it in .NET 2005 stating "Unable to start debugging on the development server". The same message is displayed when I use the IIS MMC snap-in to right-click the website's Default.aspx page, and choose browse:

    Server Application Unavailable

    The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

    Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

    ----

    I am using Windows XP (which has IIS 5.5). Firstly, note that computers running IIS 5.5, if running ASP.NET 2.0 along with a previous version of the framework (1.0 or 1.1), cannot share the same ASP.NET worker process. To fix this problem, ensure that all ASP.NET Web Sites are configured to run in their own separate process. For more information, see the following link: http://support.microsoft.com/default.aspx kbid=811320

    Next, as the problem indicates, there is a permissions issue with the ASP.NET account accessing the GAC (files stored in %windir%\assembly (eg. C:\WINNT\assembly). Have a look at http://support.microsoft.com/default.aspx kbid=811320 for details. Specifically, one thing that I noted was that the following command didn't always work as expected:

    C:\>cacls %windir%\assembly /e /t /p domain\useraccount:R

    A tip -- BEFORE trying out the above command, I would suggest downloading the excellent AccessEnum utility from http://www.sysinternals.com/Utilities/AccessEnum.html, running it, and typing C:\WINNT\assemby in the top textbox, then click the "Scan" button at the bottom. I ensured that the ASP.NET account specifically didn't have DENY permissions for ANY directory. Actually, the ASP.NET account shouldn't even be in the ACL (Access Control List), because by default, the ASP.NET account belongs to the Users group, which already has READ, EXECUTE, and LIST permissions. Note that by right-clicking on a file here, and choosing properties, it is possible to get the Windows File properties for the file, which includes the "Security" tab, for adjusting the ACL properties.

    One further thing :- by default, the %WINDIR%\Assembly folder has a modified view when viewed in Windows Explore, and the Security tab of the File properties for this folder is not available. It is the C:\WINNT\Microsoft.NET\Framework\v2.0.50727\shfusion.dll file that controls this. To access file properties, and allow viewing of this folder, unregister the file:

    C:\>regsvr32 -u C:\WINNT\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

    and to re-register the file

    C:\>regsvr32 C:\WINNT\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

    Anyway, once I had ensured that the ASP.NET account wasn't explicitly denied permissions from using files in the GAC, and ensured that I wasn't starting an ASP.NET 1.1/1.0 application first in a shared pool, and then trying to start an ASP.NET 2.0 application (on my IIS5.5 Windows XP machine), the error went away!

    Happy configuring.



  • kramer

    You need to give the account ASPNET read access to the web site's application directory.

  • MichaelMiller

    You're welcome.

  • Gary G. Little

    Please explain what you mean in the above post.  I have run into the same error message, but I got there a much different way.  I am running my app an a domain controller, so I had to change the machine.config to use DOMAIN\ASPNet userid.  Once I did that the error started appearing.  My \WINNT directory has "Authenticate Users" with read, list and execute permissions and I can not set permission on \WINNT\assembly directly so, I don't know which way to proceed.

     

    Thanks



  • Ravi Terala

    Actually, most of the time this should go away just adding .\ASPNET user to the directory users.

  • Eric Feunteun

    I used aspnet_regiis -ga domain\processusername

    This resolved the issue listed above by authorising the ASP.NET process defined in the Machine.config to the IIS Metadata.

    Check out this link - has all the possible solutions. Great PDF!


  • JWithers

    Dear all,

    I have the same problem, but the specific error was a bit difference:

    2 error always ocour:

    The first:

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: None
    Event ID: 1073
    Date: 1/23/2006
    Time: 5:54:46 PM
    User: N/A
    Computer: SOMETHING
    Description:
    Failed to initialize the AppDomain:/LM/W3SVC/1/ROOT

    Exception: System.Configuration.ConfigurationErrorsException
    Message: Exception of type 'System.Configuration.ConfigurationErrorsException' was thrown.
    StackTrace: at System.Web.Configuration.ErrorRuntimeConfig.ErrorConfigRecord.System.Configuration.Internal.IInternalConfigRecord.GetLkgSection(String configKey)
    at System.Web.Configuration.RuntimeConfigLKG.GetSectionObject(String sectionName)
    at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
    at System.Web.Configuration.RuntimeConfig.get_HostingEnvironment()
    at System.Web.Hosting.HostingEnvironment.StartMonitoringForIdleTimeout()
    at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
    at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
    at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
    at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    The follow:

    Event Type: Error
    Event Source: ASP.NET 2.0.50727.0
    Event Category: None
    Event ID: 1088
    Date: 1/23/2006
    Time: 5:54:46 PM
    User: N/A
    Computer: SOMETHING
    Description:
    Failed to execute request because the App-Domain could not be created. Error: 0x80131902

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    I use windows XP SP2, IIS V5
    ASP.NET 2.0.50727.0

    Please help me to fix this problem!




  • Webservice: "The ASP.NET process identity does not have read permissions to the global assembly cache."