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.
目录
相关文章
|
存储 SQL 测试技术
使用ClickHouse进行向量搜索 - 第二部分
本文介绍了如何使用ClickHouse进行向量搜索。总体来说,本文通俗易懂地介绍了如何使用ClickHouse进行向量搜索,包括概念、实现、高级功能和应用示例,对使用ClickHouse进行向量搜索提供了很好的概述。
52405 19
|
编译器 API 容器
Compose:从重组谈谈页面性能优化思路,狠狠优化一笔
Compose:从重组谈谈页面性能优化思路,狠狠优化一笔
726 0
|
Java API Apache
Java编程如何读取Word文档里的Excel表格,并在保存文本内容时保留表格的样式?
【10月更文挑战第29天】Java编程如何读取Word文档里的Excel表格,并在保存文本内容时保留表格的样式?
865 5
|
消息中间件 负载均衡 Kafka
Kafka分区分配策略大揭秘:RoundRobin、Range、Sticky,你真的了解它们吗?
【8月更文挑战第24天】Kafka是一款突出高吞吐量、可扩展性和数据持久性的分布式流处理平台。其核心特性之一是分区分配策略,对于实现系统的负载均衡和高可用性至关重要。Kafka支持三种主要的分区分配策略:RoundRobin(轮询)、Range(范围)和Sticky(粘性)。RoundRobin策略通过轮询方式均衡分配分区;Range策略根据主题分区数和消费者数量分配;而Sticky策略则在保持原有分配的基础上动态调整,以确保各消费者负载均衡。理解这些策略有助于优化Kafka性能并满足不同业务场景需求。
1164 59
Nest.js 实战 (十三):实现 SSE 服务端主动向客户端推送消息
这篇文章介绍了在Nest.js应用中使用Server-Sent Events (SSE)的技术。文章首先讨论了在特定业务场景下,为何选择SSE而不是WebSocket作为实时通信系统的实现方式。接着解释了SSE的概念,并展示了如何在Nest.js中实现SSE。文章包含客户端实现的代码示例,并以一个效果演示结束,总结SSE在Nest.js中的应用。
567 0
Nest.js 实战 (十三):实现 SSE 服务端主动向客户端推送消息
|
存储 人工智能 搜索推荐
生成式 AI 与 LangCHain(一)(3)
生成式 AI 与 LangCHain(一)
624 2
Python实现用鼠标截图功能
Python实现用鼠标截图功能
|
机器学习/深度学习 人工智能 自然语言处理
|
Linux 调度 数据中心
Linux cgroup资源隔离各个击破之 - io隔离
Linux Cgroup blkio子系统的用法. blkio子系统支持两种IO隔离策略 .1. cfq io调度器,支持按权重分配IO处理的时间片,从而达到IO调度和限制的目的,权重取值范围100-1000。通过以下两个文件进行配置。 blkio.weight
11575 0
|
并行计算 PyTorch 算法框架/工具
【已解决】RuntimeError: CuDA error: no kernel image is available for execution on the device
【已解决】RuntimeError: CuDA error: no kernel image is available for execution on the device