This project is read-only.

Access to the path ..........\App_Data\datastore\extensions\BBCode.xml' is denied

Apr 25, 2009 at 1:19 AM
Edited Apr 25, 2009 at 1:20 AM
I keep getting the following error when i visit my site at the following location

It only appears the first time i visit the site and asks me for a login and username. Then re-appears if i visit the site after a few minutes.
 It is some sort of authentication problem with anonymous users. I have not changed any of the code so i dont understand why the
 problem is occuring. I tried to insure that the files have read and write permissions and i altered settings on my shared hosting account
but nothing so far has solved the problem. I have blogengine 1.4.5 (18133)

Access to the path 'D:\hshome\c259493\\App_Data\datastore\extensions\BBCode.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 'D:\hshome\c259493\electronic-\App_Data\datastore\extensions\BBCode.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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[UnauthorizedAccessException: Access to the path 'D:\hshome\c259493\\App_Data\datastore\extensions\BBCode.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, Int32 bufferSize, FileOptions options) +65
   System.IO.StreamWriter.CreateFile(String path, Boolean append) +62
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) +58
   System.IO.StreamWriter..ctor(String path) +30
   BlogEngine.Core.Providers.XmlBlogProvider.SaveToDataStore(ExtensionType exType, String exId, Object settings) in C:\Documents and Settings\Owner\My Documents\creativemindmapping\DotNetSlave.BusinessLogic\Providers\XmlProvider\DataStore.cs:71
   BlogEngine.Core.Providers.BlogService.SaveToDataStore(ExtensionType exType, String exId, Object settings) in C:\Documents and Settings\Owner\My Documents\creativemindmapping\DotNetSlave.BusinessLogic\Providers\BlogService.cs:368
   BlogEngine.Core.DataStore.ExtensionSettingsBehavior.SaveSettings(ExtensionType exType, String exId, Object settings) in C:\Documents and Settings\Owner\My Documents\creativemindmapping\DotNetSlave.BusinessLogic\DataStore\ExtensionSettingsBehavior.cs:39
   BlogEngine.Core.DataStore.SettingsBase.SaveSettings(Object settings) in C:\Documents and Settings\Owner\My Documents\creativemindmapping\DotNetSlave.BusinessLogic\DataStore\SettingsBase.cs:55
   ExtensionManager.SaveToStorage() +113
   ExtensionManager.SetAdminPage(String extension, String url) +121
   seopack..ctor() +990

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   ASP.global_asax.Application_Start(Object sender, EventArgs e) +264

Apr 25, 2009 at 1:33 AM
This was fixed after 1.4.5 was released.  The solution has also been brought up in several discussions here.

In the Manager.cs file in the App_Code\ExtensionManager folder, on line 226 there is:

Stream stm = (Stream)xs.GetSettings();

... change that to ...

Stream stm = (FileStream)o;
Apr 25, 2009 at 1:45 AM

In the version i have. version 1.4.5 it has allready been changed to

Stream stm = (FileStream)o;

but the error still occurs.

This problem did not appear when i had the site on a different server. Since changing to another shared hosting account the error has appeared.

I noticed some files that had allready been placed in the directory prior to uploading my site to the new host. These files were in there by default:


I also noticed that the error appears when i try and make changes to the extensions in the control panel.

Apr 25, 2009 at 1:47 AM
The problem could be not having Write permissions enabled on the App_Data directory for the ASPNET account.  The permissions may have been there on the old server, but need to be setup again on the new server.
Apr 25, 2009 at 2:40 AM
Edited Apr 25, 2009 at 2:45 AM

Like before I right clicked on the App_Data directory. I noticed the readonly checkbox was not ticked but was selected. I unselected it.
I then published the project and un-selected the Add_Data read only permissions for the published project. I then uploaded it to the server.

Ive noticed that the read only permissions allways reverts back to a selected value. By that i mean the read only checkbox is NOT ticked but it is filled in.
This did not cause a problem before and i doubt that this is the cause of the problem now.
The error seems to occur when i revist my site after a few minutes or when i try and change the status of an extension in the control panel.

Like i said before the problem appears to exist on this hosting account only.
In the web directory settings of my shared hosting account under "Edit Web directory" if i set the Authentication level to Anonymous access
or Protected access or Allow write access the problem still occurs. In fact I’ve changed all kinds of settings but the error still appears.

My shared hosting account is using ASP.NET of version 2.0.50727.

Apr 25, 2009 at 2:59 AM
Unchecking the read-only checkbox isn't the same thing as enabling Write permissions.  I too can't completely clear the read-only checkbox -- it always comes back as partially filled.  So this is normal (for me at least).

Authentication level is also not usually the same thing as setting write permissions.  "Allow Write Access" sounds close to what we would want.  Generally what you'd want is something about file or folder permissions where you can optionally specify a separate set of permissions for each folder on your website.  A large number of hosts offer this through their control panel, but in some cases, it may be necessary to ask the hoster to set the permissions through a support ticket.

If you create a new blog post, do you see a new XML file in the App_Data\posts folder?  If you make a change on the Settings tab in the control panel, does the LastModified date for the settings.xml file in the App_Data folder get updated?
Apr 25, 2009 at 3:23 AM
Edited Apr 25, 2009 at 3:24 AM
Yes, a new post or page appears in the post or page folder. However the date on the settings file inside the App_data folder does not update
when i change the Name or Description of the Blog and click save settings. Does that help you identify the problem?
Apr 25, 2009 at 3:27 AM
Edited Apr 25, 2009 at 4:09 AM
It looks like i was wrong and indeed the settings file does update when i make a minor change in the settings page by altering the Name or description of the blog.
However the error still appears when i try and alter the status of the extensions or occassionally when i access my site.
Apr 25, 2009 at 4:57 AM
Hmm .. I got the error on your website too (the same one you pasted here).

One remote possibility is that write permissions are not set on all the folders/files within the App_Data folder.

You might want to try deleting the BBCode.xml file in the App_Data\datastore\extensions file, and then re-upload it back up to see if anything changes.

The error message is pretty clear in that ASP.NET doesn't have access to this file.  It could either be that it doesn't have access to this file in particular, or to the App_Data\datastore folder or to the App_Data\datastore\extensions folder.

Currently, in the site.master.cs file for the Indigo theme, there's this code below (or the default Indigo theme has this code).

protected void Page_Load(object sender, EventArgs e)

Temporarily replace that code with the code below.  Then pull up your blog in your browser.  You might get that one error about BBCode.xml the first time, but then just refresh the page so the code below runs.  When it runs, it'll try saving a file to the App_Data folder, the App_Data\datastore folder and the App_Data\datastore\extensions folder (3 files total).  It'll report its results at the top of the page.  This should give us a better idea if files can be saved in these 3 folders.

protected void Page_Load(object sender, EventArgs e)
  string file = Server.MapPath("~/App_Data/test1.txt");

      System.IO.File.WriteAllText(file, "test 1 ...");
      Response.Write(@"<h2>Successfully saved file to " + file + "</h2>");
  catch (Exception ex)
      Response.Write(@"<h2>Error writing to the App_Data folder ...</h2>" + GetErrorMessage(ex));

  file = Server.MapPath("~/App_Data/datastore/test2.txt");

      System.IO.File.WriteAllText(file, "test 2 ...");
      Response.Write(@"<h2>Successfully saved file to " + file + "</h2>");
  catch (Exception ex)
      Response.Write(@"<h2>Error writing to the App_Data\datastore folder ...</h2>" + GetErrorMessage(ex));

  file = Server.MapPath("~/App_Data/datastore/extensions/test3.txt");

      System.IO.File.WriteAllText(file, "test 3 ...");
      Response.Write(@"<h2>Successfully saved file to " + file + "</h2>");
  catch (Exception ex)
      Response.Write(@"<h2>Error writing to the App_Data\datastore\extensions folder ...</h2>" + GetErrorMessage(ex));

  Exception ex2 = new Exception("test");
  Response.Write("..." + GetErrorMessage(ex2));
private string GetErrorMessage(Exception ex)
  string errorMsg = ex.Message;

  while (ex.InnerException != null)
      errorMsg += "<br />" + ex.InnerException.Message;

      ex = ex.InnerException;

  return errorMsg;
Apr 25, 2009 at 6:59 AM

I did what you said and I got the following results after refreshing the page after the error appeared.

Successfully saved file to D:\hshome\c259493\\App_Data\test1.txt

Successfully saved file to D:\hshome\c259493\\App_Data\datastore\test2.txt

Successfully saved file to D:\hshome\c259493\\App_Data\datastore\extensions\test3.txt


This was after i deleted all the files and uploaded them again. The problem may be occurring because of write permissions with the App_Data folder
the first time I visit. I’ve noticed after the first time I visit the error does not appear gain until I revisit a few minutes later.
The trouble is everyone who visits my site for the first time is going to see that error message.


I’ve sent you a personal email with all my account details for my hosting server. If you wish you can alter some settings in there and that may solve the problem.


Thanks for your time. I’ll re-continue this in the morning.

Sep 2, 2009 at 9:33 AM

Did you solved the problem with BBCode.xml if so, how did you do that. I would appreciate if you will share your soloution here. Because I have the same problem and are not able to fix it my self.

Sep 2, 2009 at 8:24 PM
Edited Sep 2, 2009 at 8:30 PM

Yes, i think if i can recall it was caused by the SEO extension. I deleted all files to do with the SEO extension, deactivated it and re-uploaded my blog and i did not see the error reappear.

Im sure there is a better alternative to deleting the seo pack. The response below may help

According to Ben Amada who kindly helped me with this problem:

"I think the problem is that the seopack calls SetAdminPage() which writes all the settings into the App_Data\datastore\extensions folder at about the same time
the extensions and data are being loaded through the normal loading process when the blog application starts.  I'm guessing the normal reading of data and the
writing of the same data invoked by the seopack extension are occurring at the same time.  The access denied error could be because one process already has
that file (BBCode.xml) open or is doing something with the file while another process tries to modify the file.

One possible solution would be for the seopack to not call the SetAdminPage() method when the seopack extension is first loaded. 
It could wait a while before it calls the SetAdminPage() method.  But if you're not really using this extension, it seems simpler to just not use it. 
You also have a lot of other extensions in your blog.  It could be that the seopack extension combined with some other extension could lead to these types of conflicts."

Hope that helps



Sep 18, 2009 at 5:14 PM

Hi all, we have had a similar experience with settings.xml and posts, all resolved now. We have written a few notes on the subject of installing on IIS 6 servers here

Hope it helps!