I have a SharePoint (MOSS 2007) instance running on Windows Server 2003 and IIS 6. In IIS, I have set up an ASP.NET application via a virtual directory under the SharePoint website. SharePoint is accessed using the URL http://companyportal and the ASP.NET application is accessed using the URL http://companyportal/apps/Default.aspx. Note that the same application pool is used for both SharePoint and the ASP.NET application.
Recently, I decided to isolate the ASP.NET application into its own application pool, so it is completely independent of SharePoint and thereby will not pose any problems to the portal, should it begin to consume inordinate amount of resources for whatever reason.
So I created a new application pool for the ASP.NET application. I created a new service account to serve as the identity for this new application pool, following the steps in this MSDN blog post. I restarted the new application pool and browsed to the ASP.NET application. The behavior I observed is:
- The application loads extremely slowly.
- Eventually, the application page is displayed which means any database calls, etc. have succeeded.
- Finally, I see a
System.UnauthorizedAccessException
thrown. Since Visual Studio 2008 is on the same server, I get prompted to open the Visual Studio Just-In-Time Debugger, although that has not yielded any useful information. In Event Viewer, I see these errors:
Source: ASP.NET 2.0.50727.0 (Event ID 1334)
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/1/Root/apps
Process ID: 3028
Exception: System.UnauthorizedAccessException
Message: Access to the port is denied.
Source: .NET Runtime 2.0 Error (Event ID 5000)
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 system, P5 2.0.0.0, P6 504057aa, P7 3bf9, P8 7a, P9 system.unauthorizedaccess, P10 NIL.
After some more searching on Stack Overflow, I performed this step:
aspnet_regiis.exe -GA domain\username
and this helped make the application load faster, but the above errors continue to show up in Event Viewer.
If I use the same service account running the SharePoint application pool, I don't see any of these issues, but the moment I use the new service account, the problem(s) arise. So I believe it has something to do with the way I have set up the service account but just not sure what I am missing!