+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Web API Route Registration

Web API Route Registration

3 posts, 0 answered
  1. Luke
    Luke avatar
    8 posts
    Registered:
    12 Oct 2015
    30 Nov 2015
    Link to this post

    Hey,

    I'm trying to sort out getting web api routing registered without it crashing after a site restart.

    I am running the latest version of Sitefinity 8.2.5904

    The first boot everything works fine and then if I do something like disable/enable a module it redoes the Sitefinity bootstrapper code and my webapi routes crash with

     

    "The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code."

     

    Here is the code that I'm running:

    https://gist.github.com/luke-barnett/e1b73958880dfbab5a6d

  2. Luke
    Luke avatar
    8 posts
    Registered:
    12 Oct 2015
    03 Dec 2015
    Link to this post
    Anyone able to help with this?
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    03 Dec 2015
    Link to this post

    We do all outs in Initalized... give it a try?

    protected void Application_Start(object sender, EventArgs e)
    {
        //JsConfig.DateHandler = DateHandler.ISO8601;
        Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
    }
     
     
    void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e) {
        Config.RegisterSection<Medportal.Sitefinity.Config.MedportalConfig>();
        //Telerik.Sitefinity.Configuration.Config.RegisterSection<RandomSiteControls.Configuration.SitefinitySteveConfig>(); //Random site controls (tabstrip\etc)
     
        if (e.CommandName == "Bootstrapped")
        {

3 posts, 0 answered