Fire just once a Thread in Asp.net WebSite Global.asax

Posted by Luís Custódio on Stack Overflow See other posts from Stack Overflow or by Luís Custódio
Published on 2010-06-02T21:16:02Z Indexed on 2010/06/02 23:34 UTC
Read the original article Hit count: 252

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about winforms