Can't write any changes to blog - BE 1.5.0.7

Topics: ASP.NET 2.0, Controls
Dec 1, 2009 at 2:38 PM

I know it looks like an NTFS perms error, but I've through a half a dozen times, and even reset an re-assigned passwords and user account.  I get the following error anytime I try to save any changes to the settings page ex: changing the theme.  Oddly sometimes after dismissing the error the change I put in is made, but not always. Are there specific changes to be made to the app pool?   I'm very new to BE, love how easy it is to customize. 

Server Error in '/blog' Application.

Access to the path 'C:\....\blog\App_Data\settings.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:\Websites\WellingtonStreetConsulting\blog\App_Data\settings.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 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 165:        //  Persist settings
Line 166:        //-----------------------------------------------------------------------
Line 167:        BlogSettings.Instance.Save();
Line 168:
Line 169:        Response.Redirect(Request.RawUrl, true);


Source File: c:\Websites\WellingtonStreetConsulting\blog\admin\Pages\Settings.aspx.cs    Line: 167

Stack Trace:

[UnauthorizedAccessException: Access to the path 'C:\Websites\WellingtonStreetConsulting\blog\App_Data\settings.xml' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7714255
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +66
   System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings) +117
   BlogEngine.Core.Providers.XmlBlogProvider.SaveSettings(StringDictionary settings) +102
   BlogEngine.Core.Providers.BlogService.SaveSettings(StringDictionary settings) +26
   BlogEngine.Core.BlogSettings.Save() +323
   admin_Pages_configuration.btnSave_Click(Object sender, EventArgs e) in c:\Websites\WellingtonStreetConsulting\blog\admin\Pages\Settings.aspx.cs:167
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565



Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

<!-- [UnauthorizedAccessException]: Access to the path 'C:\Websites\WellingtonStreetConsulting\blog\App_Data\settings.xml' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings) at BlogEngine.Core.Providers.XmlBlogProvider.SaveSettings(StringDictionary settings) at BlogEngine.Core.Providers.BlogService.SaveSettings(StringDictionary settings) at BlogEngine.Core.BlogSettings.Save() at admin_Pages_configuration.btnSave_Click(Object sender, EventArgs e) in c:\Websites\WellingtonStreetConsulting\blog\admin\Pages\Settings.aspx.cs:line 167 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.admin_pages_settings_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\blog\d55c7e1c\d14d8668\App_Web_i81m8fze.12.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
Dec 29, 2009 at 10:30 PM

I'm having  the same problem - in a way. I am a new user. Trying to get this running on a Windows 7 machine, with IIS 7.5. I perfectly followed the approach in the webcast twice (@ http://nyveldt.com/misc/BE15Install.html), and when it ends, I try to change my password. I get a similar error but on users.xml instead of settings.xml. As the error states "ASP.NET is not authorized to access the requested resource. Consider granting access rights...", but I don't have an ASP.NET user, right? Just as is mentioned in the webcast, we are grant access for "NETWORK SERVICES", which I most definitely did. How to resolve this?

 

Coordinator
Dec 30, 2009 at 2:05 AM

It might not be the NETWORK SERVICE account that your site is running under.

If you go into IIS 7.5, and go into the Application Pools area, find the application pool for your site.  Click on it, then select 'Advanced Settings' on the right hand side.  A window will open up.  In the 'Process Model' section, there's "Identity".  It might be set to "Network Service".  Oftentimes, I find it's set to something else.  You can change it to Network Service.

Another possibility is making sure both Write and Modify (or Full) permissions propagate down to the subfolders.  You're probably doing this right, but sometimes all the security setting options can get confusing.

Dec 30, 2009 at 10:00 PM

Yes! Indeed that was it. Changing the identity in Application Pool.

 

Thanks for the help.