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 07, 2014 @ 20:36
    charlie black
    0

    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?

     

     

     

     

     

     

     

     

     

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 07, 2014 @ 21:03
    Jan Skovgaard
    0

    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

  • charlie black 33 posts 106 karma points
    Apr 08, 2014 @ 21:45
    charlie black
    0

     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. 

Please Sign in or register to post replies

Write your reply to:

Draft