- Storing STA components in Session state
When you store STA components in Session state, all access to the STA component is bound to the thread where it was created. When later requests are run on a different thread, access to the STA component must go through the original thread where it was created. This behavior causes a cross-apartment call and a thread switch, and severely affects performance. The new behavior binds sessions to the original thread where they were created. Therefore, later requests are bound to the original thread. - Creating STA components in a Session_Start event and storing them in Session state
When you create STA components in the Session_Start event, components are bound to the main STA thread. This behavior causes access to all STA components that are created in the Session_Start event to be limited to this single thread. The new behavior allows STA components that you create in the Session_Start event not to run on the main STA thread.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.