Copied to clipboard

Flag this post as spam?

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


  • Jin Botol 134 posts 287 karma points
    Apr 24, 2018 @ 07:05
    Jin Botol
    0

    ImageHelpers is not working after Upgrading

    Hi everyone, good day!

    I got a problem after upgrading my UmbracoCms 7.5.6 to UmbracoCms 7.10.3

    'System.Web.HtmlString' does not contain a definition for 'SafeMediaPath'
    

    Here is my helpers code : Helpers/ImageHelpers.cs/ImageHelpers/

    ....
    public static string SafeMediaPath(this IHtmlString id)
    {
       return id.ToSafeString().UmbracoMediaPath();
    }
    

    Any ideas about this?

    Appreciate any help!

    Jin

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 24, 2018 @ 07:12
    Michaël Vanbrabandt
    0

    Hi Jin,

    are these cs files of your helpers located in the same project in the App_Code folder or in a different project which has a reference from within your main project?

    If its the second one, then check if the reference to the other project is still there. If so, try to remove en re-add the reference and see if that works.

    Hope this helps.

    /Michaël

  • Jin Botol 134 posts 287 karma points
    Apr 25, 2018 @ 07:38
    Jin Botol
    0

    Hi Michael,

    Thanks for your response.

    Yes, it's the same project in the App_Code folder.

    Jin

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 25, 2018 @ 08:18
    Michaël Vanbrabandt
    0

    Hi Jin,

    Did you include the namespace of your extension class in your page where you need this extension?

    Also can you right click your .cs file and view the properties to check if the build action is set to compile?

    Hope this helps!

    /Michael

Please Sign in or register to post replies

Write your reply to:

Draft