Fire just once a Thread in Asp.net WebSite Global.asax
- by Luís Custódio
I've a legacy application using Asp.Net WebSite (winforms...) and I need run a background thread that collect periodically some files.
But this thread must run just one time!
My problem start when I put a method in Application_Start:
void Application_Start(object sender, EventArgs e) {
SetConnection();
SetNHibernate();
SetNinject();
SetExportThread();
}
So I start my application on Visual Studio and three threads start to run.
I need some singleton? or something?