Copied to clipboard

Flag this post as spam?

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


  • Hemika 4 posts 74 karma points
    May 13, 2020 @ 05:50
    Hemika
    0

    Always getting ApplicationContext.Current = NULL in external library project

    I have created a new Library project which is outside of Umbraco itself.

    Now, In the Library Project, I always get "ApplicationContext.Current = NULL" So I have googled all the things but not getting works. So after getting disappointed from everywhere I have posted in Umbraco Forum.

    Kindly help me with "How to fill AppliactionContext.Current" in the external library project.

    My library project code as below : Umbraco version 7.3.0 assembly: 1.0.5750.18157

    public void ProcessRequest(int requeatId)
    {           
            #region Application Context
    
                   var applicationContext = ApplicationContext.Current; 
    
            #endregion               
    }
    

    Kindly help me to resolve an issue as soon as possible.

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 13, 2020 @ 08:16
    Ismail Mayat
    0

    Take a look at https://github.com/sitereactor/umbraco-console-example this may give you some pointers, you need to wire everything up also you will need the web.config pointing to the umbraco database.

  • Hemika 4 posts 74 karma points
    May 13, 2020 @ 12:28
    Hemika
    0

    I don't have to host this library project anywhere.

    Here the flow is like : When a user clicks on any submit button one API is called from that API need to call another library project which hosted on another server.

    Now On that project, I am not able to get ApplicationContext.Current.

    I have tried the same flow of UmbracoBootManager and all but it gives me the following error : "Current has already been initialized on Umbraco.Core.Logging.LoggerResolver. It is not possible to re-initialize Current once it has been initialized."

    Sometimes it can be a different error than this one.

    I am always getting error at below point : enter image description here

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies