You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ApartmentState STA/MTA is only used to interop with COM and not supported on non-Windows. It also seems that dotnet can marshal between STA and MTA just fine so allowing the user to set it is just a perf optimization.
I propose we simplify our code by removing support. The code base today already has ApartmentState commented out as we run MTA by default (as that is default for dotnet) so this is simply removing the #if !CORECLR conditional code.
Steve Lee (@SteveL-MSFT) I want to add that removing support for appartmentstate would not have be good. I have seen cases where certain COM APIs can cause threading issues and lead to very bad performance, therefore the ability to optionally execute as STA is critical.
Therefore it is good that it was decided to not remove support for it. I just wanted to bring this up in case this issue gets re-considered.
Activity
SteveL-MSFT commentedon Oct 12, 2017
@PowerShell/powershell-committee discussed this and decided to leave the code as-is for 6.0.0 release
bergmeister commentedon May 21, 2018
Steve Lee (@SteveL-MSFT) I want to add that removing support for appartmentstate would not have be good. I have seen cases where certain COM APIs can cause threading issues and lead to very bad performance, therefore the ability to optionally execute as STA is critical.
Therefore it is good that it was decided to not remove support for it. I just wanted to bring this up in case this issue gets re-considered.