Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: "Value Cannot Be Null. Parameter Name: path2" Error Message When You Browse to ASP.NET Pages


View products that this article applies to.

Symptoms

When you open ASP.NET (.aspx) pages in your browser, you may receive the following error message and stack trace:
Value cannot be null. Parameter name: path2.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: path2]
   System.IO.Path.Combine(String path1, String path2)
   System.Web.FilePathParse..ctor(String path, Boolean isFile, Boolean getShortNames)
System.Web.FileChangesMonitor.StartMonitoringDirectoryRenamesAndBinDirectory(String dir, FileChangeEventHandler callback)
   System.Web.HttpRuntime.StartMonitoringDirectoryRenamesAndBinDirectory()
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) 

[HttpException (0x80004005): ASP.NET Initialization Error]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
				

↑ Back to the top


Cause

File Change detection requires that the process identity and the impersonated user identity have specific permissions to all of the directories in the hierarchy of the file path for the file that ASP.NET is monitoring if any of the directories in that hierarchy have more than eight characters in their names.

Some of the files that ASP.NET monitors are:
  • Web.config files
  • Machine.config file
  • Bin directory of an ASP.NET application
  • Cache dependency files
You receive this error message if all of the following conditions are true:
  • The root directory has more than eight characters.
  • The rest of the directories in the file path have less than nine characters.
  • The Aspnet_wp.exe process identity (the ASPNET account by default) or the impersonated account does not have permissions on the root directory in the hierarchy of that file path.
If the file path hierarchy does not match this condition exactly, you may receive a different error message. For more information, see the "References" section of this article.

↑ Back to the top


Resolution

To work around this problem, use one of the following methods.

Workaround 1

Make sure that all of the directory names in the hierarchy of that file path are less than nine characters long. For example:
C:\Web\Users\MainDir\Site1

Workaround 2

Grant the required permissions to the Aspnet_wp.exe process identity (the ASPNET account by default) on all of the directories in that hierarchy or the impersonated account (if impersonation is turned on).

To do this, follow these steps:
  1. In Windows Explorer, locate the application folder or the virtual directory that contains the content (for example, D:\MyWebApplications\Users\Main\App1).
  2. Right-click the root folder (MyWebApplications in this case), and then click Properties.
  3. On the Security tab, click Add.
  4. Type ComputerName\ASPNET (for example, on a computer that is named Webdev, type Webdev\ASPNET), and then click OK. Add the impersonated accounts if impersonation is turned on.
  5. Grant the following permissions for the ASPNET account (and for the impersonated accounts if impersonation is turned on):
    • Read & Execute
    • List Folder Contents
    • Read

  6. Click OK to close the Properties dialog box and to save the changes.
If you have to grant more restrictive permissions to these folders, follow these steps after you complete step 4:
  1. Click Advanced to access special permissions or advanced settings.
  2. Click the Permissions tab, and then select the permission entry for the ASPNET (or other impersonated account).
  3. Click View/Edit.
  4. Make sure that you grant only the List Folder/Read Data permission.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in ASP.NET (included with the .NET Framework) 1.1.

↑ Back to the top


More information

If the error message that you receive is the same as the error message that is listed in the "Symptoms" section of this article, but the stack trace does not match the stack trace in the "Symptoms" section, the cause of your error message may be different. For more information, see the "References" section of this article.

↑ Back to the top


References

For additional information about a different error message for the same cause, click the article number below to view the article in the Microsoft Knowledge Base:
316721 PRB: "Failed to Start Monitoring Directory Changes" Error Message When You Browse to ASP.NET Page
317955 BUG: "Failed to Start Monitoring Directory Changes" Error Message When You Browse to an ASP.NET Page
For additional information about the minimum permissions that you must grant to the ASPNET account to run your ASP.NET applications, click the article number below to view the article in the Microsoft Knowledge Base:
317012 INFO: Process and Request Identity in ASP.NET
For additional information about ASP.NET security, click the article number below to view the article in the Microsoft Knowledge Base:
306590 INFO: ASP.NET Security Overview

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: KB320117, kbsecurity, kbconfig, kbbug, kbfix

↑ Back to the top

Article Info
Article ID : 320117
Revision : 3
Created on : 3/21/2003
Published on : 3/21/2003
Exists online : False
Views : 579