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 8996191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:43:17+00:00 2026-06-15T23:43:17+00:00

I am using SharpBITS (http://sharpbits.codeplex.com/), a well running BITS wrapper for .NET. I am

  • 0

I am using SharpBITS (http://sharpbits.codeplex.com/), a well running BITS wrapper for .NET. I am not quite sure but reckon that BITS must run in a Single Thread Apartment (STA). With older versions I had some problems when running BITS in a Multi Threaded Apartment (MTA) which is for example default for .NET console applications. I do not find anything about that in the BITS documentation or on the Internet.

Even SharpBITS tries to set the apartment state in the constructor of BitsManager to STA (what actually would only be possible before a thread is started).

Does someone know if BITS really must run in an STA? The currrent version seems to run as well in a MTA.

  • 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-15T23:43:18+00:00Added an answer on June 15, 2026 at 11:43 pm

    No. The various versions of the BackgroundCopyManager coclass are registered in the registry with the ThreadingModel key set to “Both”. Which means that you can create one in an MTA thread (default for any Thread you create yourself or a console app’s main thread) and calls will not be marshaled. And if you create one in an STA thread then calls will be marshaled back to that thread.

    And yes, MTA can create problems because now it is up to you to ensure that your own code is thread-safe. There are a lot of guarantees you get from an STA thread, you in effect borrow the thread-safety that COM provides. No such guarantees from an MTA, you have to make sure your code is as thread-safe as BITS is. The notifications you’ll get from BITS would be the typical troublemaker, locking is required to protect your own state.

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

Sidebar

Related Questions

I'm using the c# wrapper sharpBITS as a means to download files via HTTP.
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using System.Diagnostics.EventLog .NET type one can programmatically create logs into the Event Viewer application.
Using jQuery I'm trying to obtain the rotation state of an object but in
Using C# How can I show a document in richtextbox without scrollbars, But I
I have a service to download file using credential domain\user but get this error
Using ASP.NET MVC 4 RTW, how do I log MVC controller actions and parameters
Has any one used BITs in VB.NET? If so, do you have code samples
Using the Exiv2 library to write some exif tags to an image i'm running

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.