tags:

views:

34

answers:

2

Here is one of several sources that say ASP.NET defaults to single-threaded apartment, and that you have to set "executeInMta" to true in order to override this behavior (EDIT: As everyone has pointed out, I am wrong here - this refers to classic ASP. I thought there was more documentation backing this up for ASP.NET, but I was wrong):

http://www.iis.net/ConfigReference/system.webServer/asp/comPlus

Here is one of several sources that say that ASP.NET defaults to multi-threaded apartment, and that you have to set "aspCompat" to true in order to override this behavior:

http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp

So, which is it? I currently do neither of the above overrides, and I want to be in MTA mode. Related question - is there a way to tell by debugging whether the currently-executing thread is STA or MTA?

Thank you.

+1  A: 

The first article you linked refers to ASP, not ASP.NET. Classic ASP defaults to using STA, whereas ASP.NET defaults to using MTA.

Scott Anderson
+1  A: 

Your first reference is from the ComPlus configuration setting for IIS7, and appears to apply to classic ASP.

ASP.NET threads are MTA by default.

Joe