Copied to clipboard

Flag this post as spam?

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


  • charlie black 33 posts 106 karma points
    Apr 15, 2014 @ 01:39
    charlie black
    0

    another api question

    When we developed some code based off umbraco 4.7.2 we made this call:

    var doc = UmbracoContext.Current.Server.ContentXml;

     

    But when we upgrade to 6.1.0, this above call generates several warnings about obsolete.

    I tried this:

     var doc = Umbraco.Web.UmbracoContext.Current.ContentCache.InnerCache.TryConvertTo<XDocument>();

    but this causes runtime System.InvalidCastException error:

    {"Unable to cast object of type 'Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache' to type 'System.Xml.Linq.XDocument'."}

    What I'm looking for is the XDocument representation of the cache xml ? Does anyone know how to get it in 6.1.0?

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies