Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8138167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:24:29+00:00 2026-06-06T11:24:29+00:00

In an ASP.NET MVC, when the application start, I need to some connections (LDAP,

  • 0

In an ASP.NET MVC, when the application start, I need to some connections (LDAP, …) in background. Is there a way to do this “thread safe” in a ASP.NET MVC application ?

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:24:30+00:00Added an answer on June 6, 2026 at 11:24 am

    You should avoid running background tasks in AS.NET. But if for some reason you need to do it, you could start a new thread in Application_Start and perform those tasks. Since Application_Start executes only once, this thread will run once (unless of course you configure some timer -> which you probably should not be doing).

    If on the other hand you need to consume the work done in this background thread from your ASP.NET MVC controllers (which run inside the context of an HTTP request) you will need proper synchronization in order to ensure that the initialization thread you started in Application_Start has finished. Depending on your exact scenario there might be different ways to achieve that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC application using Authorization Attributes on Controllers and Actions. This
In my ASP.net MVC application i need to get the host of the application
I created a new ASP.NET MVC application. The home page looks like this: I
I'm developing an web application using asp.net mvc, and i need to do a
I have an ASP.NET MVC 3 (.NET 4) web application. This app fetches data
Currently I am working on small application in asp.net mvc. It is a some
I need to initialize StructureMap.ObjectFactory in ASP.NET MVC 3 application. ObjectFactory.Initialize(x => x.For<Db>().HttpContextScoped().Use<Db>()); Do
In an ASP.NET MVC application during application_start a new thread gets startet. The thread
I am creating an ASP.NET MVC application that has postcode lookup functionality. I capture
I have an Asp.Net MVC application that works in the vs.net development web server.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.