Aspcompat on an aspx page

On my aspx pages, I invoke a COM component that uses the STA. Therefore, I use the aspcompat = true parameter, but I want to understand the logic. What is he doing? To my knowledge, the STA assumes that it is assumed to be only one thread. Therefore, I must ensure thread safety.

If this is correct, where does the aspcompat parameter provide thread safety? Throughout the page or just at the access point to the STA component?

+3
source share
3 answers

This directive forces ASP.NET to provide access to ASP-intrinsic objects and changes the thread pool to MTA.

Learn more about paying this.

+1
source

, ; Pro.NET

AsP.nET MTA. sTA , . sTA , . , ASPCOMPAT :

<%@Page Language = "vb" AspCompat = "true" %>

, - MTA, sTA Page_Load Page_Init.

+1

COM- (STA), , Visual Basic, ASP.NET, AspCompat = true

<%@ Page>

ASP.NET

AspCompat STA

ASP.NET MTA ( )

ASP.NET, COM , , VB6 Visual FoxPro (MTDLL), , , , . STA - COM . STA , COM- , COM- STA. , , COM- , .

ASP.NET MTA ( ), , COM . , STA, , - thread/COM . MTA COM , STA COM .

STA ASP.NET

STA ASP.NET . , ASP.NET WebForms STA STA Page Handler ASPCOMPAT. WebForms, STA , ASPCOMPAT @Page:

<%@ Page Language="C#" AspCompat="true" %>

STA. MTA. .

STA ASP.NET

WebForms STA

  • ASP.NET HttpHandlers
  • - ASMX
  • ASP.NET MVC
  • - WCF
  • -API ASP.NET

STA - . : -)

:

https://weblog.west-wind.com/posts/2012/Sep/18/Creating-STA-COM-compatible-ASPNET-Applications#STAfornonsupportingASP.NETTechnologies

+1

Source: https://habr.com/ru/post/1796664/


All Articles