Preloading variables in RoleEntryPoint OnStart

I need to download some tables from the database, and create static list classes with the information. I can do this in owin startup, or RoleEntryPoint onStart.

I tried to preload the lists in RoleEntryPoint onStart, however, these classes doesnt seem to be available in the runtime, instead they got created again.

If I preload them in Owin Startup, everything works as it should.

However, it takes about 10 seconds for me to preload these lists, and while owin startup is executing, the Onstart already had been executed and therefore the web role becomes available for accepting requests. I dont want this though. I dont want the web role to switch to ready state until all of the lists are preloaded.

it seems like any instances that are created in RoleEntryPoint arent available in the webrole runtime itself.

Is there any way to achieve preloading instances in OnStart and having being able to use them in the runtime?

August 25th, 2015 6:18am

Hi,

 You may want to look into using Application_Start() Event coupled with the Auto-Start feature. Refer the link below.
 http://weblogs.asp.net/scottgu/auto-start-asp-net-applications-vs-2010-and-net-4-0-series
 
 Let us know if this helps.

Regards,
Nithin Rathnakar

Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 10:35am

Hi,

 You may want to look into using Application_Start() Event coupled with the Auto-Start feature. Refer the link below.
 http://weblogs.asp.net/scottgu/auto-start-asp-net-applications-vs-2010-and-net-4-0-series
 
 Let us know if this helps.

Regards,
Nithin Rathnakar

August 25th, 2015 2:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics