We have a intranet site (virtual directory) running on IIS 6. One of the functions of this site is a facility for our users to be able to click a button and a .csv report gets generated. This fails because the site does not have access to write the file on the server. Any help on this would be great thanks.
ASP.NET 2.0
Anonymous access enabled
Integrated Windows Authentication
Does not work locally on the server or with a Domain Admin account
Application pool set to Network Service
This is the error we receive in IE on the server and client:
Access to the path '\\hostname\d$\InetPub\ Calls 28022011.csv' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path '\\hostname\d$\InetPub\ Calls 28022011.csv' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 45: D.Call_Problem + "\"";
Line 46:
Line 47: using (var CSVWriter = new StreamWriter(LiveFilePath + ddlCompany.SelectedValue + "\\" + FileName))
Line 48: {
ASP.NET 2.0
Anonymous access enabled
Integrated Windows Authentication
Does not work locally on the server or with a Domain Admin account
Application pool set to Network Service
This is the error we receive in IE on the server and client:
Access to the path '\\hostname\d$\InetPub\ Calls 28022011.csv' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path '\\hostname\d$\InetPub\ Calls 28022011.csv' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 45: D.Call_Problem + "\"";
Line 46:
Line 47: using (var CSVWriter = new StreamWriter(LiveFilePath + ddlCompany.SelectedValue + "\\" + FileName))
Line 48: {