Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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?
is working on a reply...