Microsoft KB Archive/320117

= FIX: &quot;Value Cannot Be Null. Parameter Name: path2&quot; Error Message When You Browse to ASP.NET Pages =

Article ID: 320117

Article Last Modified on 3/21/2003

-

APPLIES TO


 * Microsoft ASP.NET 1.0

-



This article was previously published under Q320117



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)



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 &quot;References&quot; section of this article.



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:  In Windows Explorer, locate the application folder or the virtual directory that contains the content (for example, D:\MyWebApplications\Users\Main\App1). Right-click the root folder (MyWebApplications in this case), and then click Properties. On the Security tab, click Add. Type \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. Grant the following permissions for the ASPNET account (and for the impersonated accounts if impersonation is turned on):  Read & Execute</li> List Folder Contents</li> Read</li></ul>

</li> Click OK to close the Properties dialog box and to save the changes.</li></ol>

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.

<div class="status_section">

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.

<div class="moreinformation_section">

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

<div class="references_section">