Copied to clipboard

Flag this post as spam?

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


  • quachnguyen 12 posts 32 karma points
    Mar 29, 2018 @ 09:37
    quachnguyen
    0

    Null Context exception was throw

    Hello all,

    I followed this article: http://scottsdevblog.com/2011/07/adding-an-mvc-or-other-net-application-in-umbraco-cms-4-7/

    In my solution is: Umbraco 7.10 and MVC Application as bellow URL Umbraco: http://orgin.local MVC App: http://http://orgin.local/Origin

    here is my IIS configuration:

    enter image description here

    My problem is when I start to localize the text using Umbraco API or inherit my page to @inherits Umbraco.Web.Mvc.UmbracoTemplatePage

    The site will throw exception

    enter image description here Please tell me how could I fix it? Do I need to create a Fake UmbracoContext? If possible please give me solution code

    Many thank you for your help Quách

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Mar 29, 2018 @ 10:33
    Søren Gregersen
    0

    hi,

    First of all, that guide is very old - for umb 4.7. Some things may by the same, but I really don't see what the guide tries to solve.

    By adding your application in virtual directory, you run into alot of configuration issues that you must be aware of. I would suggest not doing this.

    Normally I would just create a new controller in the website, and put your custom code into that. It's not uncommon to have a controller for each documenttype, thus allowing you to have custom code on all pages. This would also make it possible for your editors to create the type of pages that contain your custom code - be it a form, product-listings etc.

    As per fixing your issue at hand, you would need to provide some more code.

  • quachnguyen 12 posts 32 karma points
    Mar 29, 2018 @ 11:14
    quachnguyen
    0

    Could you help me?

  • quachnguyen 12 posts 32 karma points
    Mar 29, 2018 @ 10:42
    quachnguyen
    0

    Hello @Søren Gregersen,

    Thanks for your reply my question, the reason to make a virtual directory that we want to separate an MVC application outside Umbraco project;

    The Umbraco project is only for configuration and and MVC project is calling umbraco API to get that configuration/localize (translate text)

    Do you have any other idea?

    enter image description here

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft