show the error messageif your component is a single-threaded apartment(STA) component, make sure to use<%@ Page AspCompat="true" %>Note,Setting this attribute to true can cause your page's performance to degrade

解决方案 »

  1.   

    com中的Cconnection::OnStartPage无法执行,加了<%@ Page AspCompat="true" %>也不行
      

  2.   

    seehttp://samples.gotdotnet.com/quickstart/aspplus/doc/cominterop.aspx
    ASP.NET also continues to support the existing ASP intrinsic interfaces ObjectContext Intrinsic Flow, OnStartPage, and OnEndPage. Supporting these interfaces means that you can use existing components (Commerce Server, Exchange, and so on) in ASP.NET pages. These interfaces are not enabled by default but are explicitly turned on using the following page directive: <%@ Page ASPCompat="true" %>This directive causes ASP.NET to create unmanaged ASP intrinsic objects and pass them to COM components used in the page. It also runs the page in an STA thread pool. See the following section for information.