zoukankan      html  css  js  c++  java
  • What does AspCompat="true" mean and when should I use it?

    AspCompat is an aid in migrating ASP pages to ASPX pages. 
    It defaults to false but should be set to true in any ASPX 
    file that creates apartment-threaded COM objects--that is, 
    COM objects registered ThreadingModel=Apartment.
    
    That includes all COM objects written with  Visual Basic 
    6.0. AspCompat should also be set to true (regardless of 
    threading  model)  if the page creates COM objects that 
    access intrinsic ASP objects such as Request and Response. 
    The following directive sets AspCompat to true:
    
    
    <%@ Page AspCompat="true" %>  
    Setting AspCompat to true does two things. First, it makes 
    intrinsic ASP objects available      to the COM components 
    by placing unmanaged wrappers around the equivalent ASP.NET 
    objects. 
    
    Second, it improves the performance of calls that the page 
    places to apartment- threaded COM objects by ensuring that 
    the page (actually, the thread that processes the  request 
    for the page) and the COM objects it creates share an 
    apartment. 
    
    AspCompat="true" forces ASP.NET request threads into single-
    threaded apartments (STAs). If those threads create COM 
    objects marked ThreadingModel=Apartment, then the objects 
    are created in the same STAs as the threads that created 
    them. Without AspCompat="true," request threads run in a 
    multithreaded apartment (MTA) and each call to an STA-based 
    COM object incurs a performance hit when it's  marshaled 
    across apartment boundaries.
    
    Do not set AspCompat to true if your page uses no COM 
    objects or if it uses COM objects that don't access ASP 
    intrinsic objects and that are registered 
    ThreadingModel=Free or  ThreadingModel=Both.
  • 相关阅读:
    ISCC 2018——write up
    图的存储结构(十字链表、邻接多重表、边集数组)
    图的存储结构
    树梅派(Raspberry Pi 3b)安装kali linux 2.0
    树梅派3B kali2.0 启用SSH进行远程登录
    VS+VAssistX自动添加注释
    libtiff库使用
    word采用尾注进行参考文献排版的一些问题
    vs2008安装opencv2.4.6
    Altera CYCLONE III FPGA BGA布线
  • 原文地址:https://www.cnblogs.com/zhangqs008/p/2802203.html
Copyright © 2011-2022 走看看