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, 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!

1 Answer 1


Did you add your custom user to the IIS_WPG group? That's a requirement in IIS6. Running aspnet_regiis -GA will grant some but not all of the permissions that IIS_WPG takes care of.

Also make sure that your custom account has at least read permissions on disk, although that's not the specific cause of the errors that you mentioned.

  • I added the custom user to the IIS_WPG group on the domain controller server first and it didn't work. I realized that and later added it to the IIS_WPG group on the web server and I was at least able to load the application, albeit slowly. So it still seems to related to permissions. When you say Read permissions on disk, do you mean the entire disk?
    – Web User
    Oct 6, 2015 at 2:56
  • That sounds like progress. Your error message about the 'port' seems like it could be a web service call from your application. Do you have anything that needs to make a call and could time out? For permissions, it should be on the disk of the site path. You can right-click on the site in IIS and click Edit Permissions. Also check your anonymous user. That also needs to have permissions on disk (more so in IIS6) Oct 6, 2015 at 13:46
  • I added the user via virtual directory -> permissions, since it is a different location than the site itself. I also added Anonymous user. That didn't do much, The application makes a call to SQL Server, if that means anything. If I load a simple test ASPX page that contains only static content, there is no issue at all. I have another related question. I decided to silo off this ASP.NET application because it was using Session. But any session related code is throwing a NullReferenceException; the web.config lacks configuration for Session. What should I add in there?
    – Web User
    Oct 7, 2015 at 3:00
  • To troubleshoot this you may need to step through your code, or narrow it down by commenting out code until you determine the issue. If it works with a static page then it sounds like the issue is code related and not the IIS configuration. You can also test with a simple ASP.NET page. Session state should default to InProc if it's not already set. Are you sure you're not using StateServer? You can manage it using IIS Manager at the site level. There is a Session State node as long as you have ASP.NET installed. Oct 10, 2015 at 2:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .