Copied to clipboard

Flag this post as spam?

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


  • Peter Cort Larsen 421 posts 1038 karma points
    Sep 08, 2015 @ 07:47
    Peter Cort Larsen
    0

    umb 7 MVC get debug info from macro

    Hi,

    When i add ?umbDebugShowTrace=true i dont get any usable debug info, like when i used webforms. I just get the miniprofiler, but i cant see whats wrong in my macro.

    I have this in my web.config:

    Can anyone help?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 08, 2015 @ 08:14
    Dennis Aaen
    1

    Hi Peter,

    Have you added this to your web.config file

     <compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5">
          <buildProviders>
            <add extension=".cshtml" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
            <add extension=".vbhtml" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
            <add extension=".razor" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
          </buildProviders>
        </compilation>
    

    And then to get the debug info you should add this query string to the url

    ?umbdebug=true
    

    Hope this helps,

    /Dennis

  • Peter Cort Larsen 421 posts 1038 karma points
    Sep 08, 2015 @ 08:37
    Peter Cort Larsen
    0

    Hi, thank you for answering.

    i tried adding debug=true.

    It still just gives me the profiler with a red link. But there are no usefull info.

    http://www.pcl.dk/err_red.png http://www.pcl.dk/err.png

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Sep 08, 2015 @ 19:02
    Sebastiaan Janssen
    101

    In order to get debug info for macros you can do a few things:

    • Use visual studio and set breakpoints
    • Enable tracing in your web.config and visit /trace.axd to get info like you used to get when using webforms (in MVC it's not possible to add this info inline with the page any more
    • Go into your ~./config/umbracoSettings.config and change the line <MacroErrors>inline</MacroErrors> to <MacroErrors>throw</MacroErrors> - this will give you errors right where the macro is in the page

    Of course you can also add logging yourself so you can see what's going on in your code.

  • Peter Cort Larsen 421 posts 1038 karma points
    Sep 09, 2015 @ 07:10
    Peter Cort Larsen
    0

    Great thanks, that helped

Please Sign in or register to post replies

Write your reply to:

Draft