Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • rboogaerts 11 posts 132 karma points
    Feb 03, 2017 @ 10:59
    rboogaerts
    0

    IO Exception umbraco.config v.7.2.5 hosted on azure

    Sometimes we get IO exceptions on umbraco.config. Stack trace below. The error stays until I restart the website. It is hosted on Azure and we use Umbraco version 7.2.5 assembly: 1.0.5610.18894 (we will update soon).

    As I understand, umbraco.config is used for caching. I've recently added some caching to the website with the following code:

    var cache = ApplicationContext.Current.ApplicationCache.RuntimeCache;
                var cachedItem = cache.GetCacheItem(key);
    
                if (cachedItem == null)
            {
             .... some code....
    
                var toReturn = items.OrderByDescending(i => i.GetPropertyValue("date")).Take(5);
                cache.InsertCacheItem(key, () => { return toReturn; }, TimeSpan.FromHours(_cachingDuration));
    
                return toReturn;
    
            }
    
            return cachedItem as IEnumerable<DynamicNode>;
    

    Could this be the cause of the IO exception? Does anyone know how to fix this or should I log it as a bug?

      An unhandled exception occurred
        System.IO.IOException: The process cannot access the file 'D:\home\site\wwwroot\App_Data\umbraco.config' because it is being used by another process.
        at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
        at System.IO.File.InternalDelete(String path, Boolean checkHost)
        at System.IO.File.Delete(String path)
        at umbraco.content.DeleteXmlFile()
        at umbraco.content.LoadXmlFromFile()
        at umbraco.content.LoadXmlLocked(SafeXmlReaderWriter safeXml, Boolean& registerXmlChange)
        at umbraco.content..ctor()
        at umbraco.content.<.cctor>b__14()
        at System.Lazy`1.CreateValue()
        --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Lazy`1.get_Value()
        at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.<get_GetXmlDelegate>b__3(UmbracoContext context, Boolean preview)
        at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetXml(UmbracoContext umbracoContext, Boolean preview)
        at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.HasContent(UmbracoContext umbracoContext, Boolean preview)
        at Umbraco.Web.PublishedCache.ContextualPublishedCache`1.HasContent(Boolean preview)
        at Umbraco.Web.UmbracoModule.EnsureHasContent(UmbracoContext context, HttpContextBase httpContext)
        at Umbraco.Web.UmbracoModule.EnsureUmbracoRoutablePage(UmbracoContext context, HttpContextBase httpContext)
        at Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext)
        at Umbraco.Web.UmbracoModule.<Init>b__a(Object sender, EventArgs e)
        at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
        at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    
  • Peter Duncanson 430 posts 1360 karma points c-trib
    Feb 03, 2017 @ 11:31
    Peter Duncanson
    100

    Your caching code won't clash with Umbraco at all. The umbraco.config file is for custom caching of your content that Umbraco handles so thats not the culprit. So you can sleep easy there.

    Suggest you upgrade and in see if that settles it. A lot of changed since v7.2

    Pete

Please Sign in or register to post replies

Write your reply to:

Draft