we previously were using 4.7.2 and had in our codebase calls to:
using umbraco.presentation;
UmbracoContext.Current.Server.MapPath(..)
UmbracoContext.Current.Server.ContentXmlPath
UmbracoContext.Current.NewSchemaMode
var doc =UmbracoContext.Current.Server.ContentXml
we are getting these warnings now when compiling:
Warning 75 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 76 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 77 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 78 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 79 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 80 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 81 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead' Warning 82 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
but I do NOT see equivalent methods in the Umbraco.Web.UmbracoContext class e.g. the property Server in umbraco.presentation.UmbracoContext does NOT exist for Umbraco.Web.UmbracoContext. How can I replace these calls?
I know things have changed from these versions - But I'm not a backend developer so I don't know the equilvaents but thought that perhaps you can maybe find some usefull information in the documentation here? http://our.umbraco.org/documentation/Reference/
var doc = UmbracoContext.Current.Server.ContentXml;
causes
warning CS0618: 'umbraco.presentation.UmbracoServerUtility.ContentXml' is obsolete: 'This is no longer used in the codebase and will be removed. If you need to access the current XML cache document you can use the Umbraco.Web.Umbraco.Context.GetXml() method.'
But the Umbraco.Web.Umbraco.Context.GetXml() method is internal.
changes from 4.7.2 to 4.11.10
we previously were using 4.7.2 and had in our codebase calls to:
using umbraco.presentation;
UmbracoContext.Current.Server.MapPath(..)
UmbracoContext.Current.Server.ContentXmlPath
UmbracoContext.Current.NewSchemaMode
var doc = UmbracoContext.Current.Server.ContentXml
we are getting these warnings now when compiling:
Warning 75 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 76 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 77 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 78 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 79 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 80 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 81 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
Warning 82 'umbraco.presentation.UmbracoContext' is obsolete: 'Use Umbraco.Web.UmbracoContext instead'
but I do NOT see equivalent methods in the Umbraco.Web.UmbracoContext class e.g. the property Server in umbraco.presentation.UmbracoContext does NOT exist for Umbraco.Web.UmbracoContext. How can I replace these calls?
Hi Charlie
I know things have changed from these versions - But I'm not a backend developer so I don't know the equilvaents but thought that perhaps you can maybe find some usefull information in the documentation here? http://our.umbraco.org/documentation/Reference/
/Jan
in 4.11.10 using
var doc = UmbracoContext.Current.Server.ContentXml;
causes
warning CS0618: 'umbraco.presentation.UmbracoServerUtility.ContentXml' is obsolete: 'This is no longer used in the codebase and will be removed. If you need to access the current XML cache document you can use the Umbraco.Web.Umbraco.Context.GetXml() method.'
But the Umbraco.Web.Umbraco.Context.GetXml() method is internal.
I can't access it.
is working on a reply...