"Access to the path "...PortalCfg.xml" is denied

  • Thread starter Thread starter Winterminute
  • Start date Start date
W

Winterminute

If I try to make any changes to the ASP.NET Portal Starter kit it fails with
an access denied error.

This was working when I left last week and is failing today. I don't
remember changing anything, but I guess something had to be changed. I
have checked NTFS permissions and the ASPNET account has full control on the
parent directory of that XML file and on the file itself. I have also
checked in IIS, and the Virtual Directory has "write" allowed. The funny
thing is that the change I am trying to make works! So if I reload the page
I see the change, but attempting to make another change results in the
error.


Here is the full error:
(I can post the entire stack trace if you want)

Server Error in '/PortalCSVS' Application.

Access to the path "C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal
(CSVS)\PortalCSVS\PortalCfg.xml" 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
"C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal
(CSVS)\PortalCSVS\PortalCfg.xml" 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 write 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 776:
Line 777: // Object is evicted from the Cache here.
Line 778: siteSettings.WriteXml(configFile);
Line 779: }
Line 780: }
 
I found out that in Windows 2003, ASPNET isn't used for permissions if IIS is running under "Network Service", so once I get permissions to the Network Service Account and did an IISRESET, it worked!
If I try to make any changes to the ASP.NET Portal Starter kit it fails with
an access denied error.

This was working when I left last week and is failing today. I don't
remember changing anything, but I guess something had to be changed. I
have checked NTFS permissions and the ASPNET account has full control on the
parent directory of that XML file and on the file itself. I have also
checked in IIS, and the Virtual Directory has "write" allowed. The funny
thing is that the change I am trying to make works! So if I reload the page
I see the change, but attempting to make another change results in the
error.


Here is the full error:
(I can post the entire stack trace if you want)

Server Error in '/PortalCSVS' Application.

Access to the path "C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal
(CSVS)\PortalCSVS\PortalCfg.xml" 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
"C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal
(CSVS)\PortalCSVS\PortalCfg.xml" 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 write 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 776:
Line 777: // Object is evicted from the Cache here.
Line 778: siteSettings.WriteXml(configFile);
Line 779: }
Line 780: }
 
Back
Top