Execute code on startup RRS feed

  • Question

  • I have a WCF application created using VS 2017 and .net 4.7, and I need to run some code on startup.  I created an App_Start folder and added a Global.asax file but it's "Application_Start" method doesn't execute.  Then I installed WebActivatorEx via Nuget and added the required code but I still can't get anything to run on startup.

    [assembly: WebActivatorEx.PostApplicationStartMethod(typeof(VelocityService.Global), "InitializeConfigData")]
    namespace VelocityService
        public class Global : System.Web.HttpApplication
            public static void InitializeConfigData()
    	   // startup code here

    Any ideas on how to make InitializeConfigData() execute on startup?


    Monday, September 4, 2017 9:13 PM

All replies