Strange behavior when using AspCompat=true

Discussion in 'ASP .Net' started by Nicholas Palmer, Jan 22, 2007.

  1. Hi all,

    Got a question about the AspCompat=true page property. First a little
    background. We have an ASP.NET app that uses two COM components. The first
    is the Microsoft OWC 11 components and the second is a custom VB6 COM
    component. So I was reading about AspCompat=true and it seemed like it would
    be a good fit for our app. From what I can tell both of the COM components
    that we are using are STA and we are creating the components in Page_load
    event as is required so it seems like we are a good fit for using
    AspCompat=true. So I added that to the pages in our app where we create the
    COM objects. And did some testing and I've gotten some strange results. The
    very first time I run my app, I get faster performance. I can tell this
    because the both components are using in generating visual information and
    when I run the app the first time, the display comes up faster than it did
    without the AspCompat=true page property. But if close the app and then
    launch another browser and start the app up again, my performance goes back
    to the way it was before I added the AspCompat=true. Its very strange. I
    have duplicated this test several times to confirm what I was seeing and I
    get the same behavior every time. I have tried the same test on two
    different machines and get consistent behavior. It seems the only time I get
    improved performance is if I do an IISRESET to recycle IIS and then run the
    app. That first session runs fast but then non after it do. Does anyone have
    any clues as to what might be happening ? Do I need to add the
    AspCompat=true page property to every page in my project or just the pages
    that have the COM objects ?

    Thanks in advance,

    Nick
    Nicholas Palmer, Jan 22, 2007
    #1
    1. Advertising

  2. Thats what I have done, and I do actually see a performance benefit, but I
    only seem to get it the first time I run the app. Do I have to add the
    ASPCOMPAT=true to every page in the project ?

    Nick

    "Peter Bromberg [C# MVP]" <> wrote in
    message news:D...
    > If your COM objects are not Freethreaded (especially, the VB one is
    > definitely not!) then you need ASPCOMPAT=true on any page that uses these.
    > These guys need to run on an STA thread and the standard ASP.NET page
    > arrangement is not STA.
    > There is a performance hit from doing this but that's life.
    > Peter
    >
    > --
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > Short urls & more: http://ittyurl.net
    >
    >
    >
    >
    > "Nicholas Palmer" wrote:
    >
    >> Hi all,
    >>
    >> Got a question about the AspCompat=true page property. First a little
    >> background. We have an ASP.NET app that uses two COM components. The
    >> first
    >> is the Microsoft OWC 11 components and the second is a custom VB6 COM
    >> component. So I was reading about AspCompat=true and it seemed like it
    >> would
    >> be a good fit for our app. From what I can tell both of the COM
    >> components
    >> that we are using are STA and we are creating the components in Page_load
    >> event as is required so it seems like we are a good fit for using
    >> AspCompat=true. So I added that to the pages in our app where we create
    >> the
    >> COM objects. And did some testing and I've gotten some strange results.
    >> The
    >> very first time I run my app, I get faster performance. I can tell this
    >> because the both components are using in generating visual information
    >> and
    >> when I run the app the first time, the display comes up faster than it
    >> did
    >> without the AspCompat=true page property. But if close the app and then
    >> launch another browser and start the app up again, my performance goes
    >> back
    >> to the way it was before I added the AspCompat=true. Its very strange. I
    >> have duplicated this test several times to confirm what I was seeing and
    >> I
    >> get the same behavior every time. I have tried the same test on two
    >> different machines and get consistent behavior. It seems the only time I
    >> get
    >> improved performance is if I do an IISRESET to recycle IIS and then run
    >> the
    >> app. That first session runs fast but then non after it do. Does anyone
    >> have
    >> any clues as to what might be happening ? Do I need to add the
    >> AspCompat=true page property to every page in my project or just the
    >> pages
    >> that have the COM objects ?
    >>
    >> Thanks in advance,
    >>
    >> Nick
    >>
    >>
    >>
    Nicholas Palmer, Jan 23, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Angelo Brusati
    Replies:
    3
    Views:
    1,415
    Angelo Brusati
    Mar 31, 2005
  2. bdb112
    Replies:
    45
    Views:
    1,316
    jazbees
    Apr 29, 2009
  3. Tang Heng
    Replies:
    0
    Views:
    396
    Tang Heng
    Aug 27, 2009
  4. Kit Truong

    Page directive aspcompat="true" error

    Kit Truong, Dec 23, 2005, in forum: ASP General
    Replies:
    0
    Views:
    218
    Kit Truong
    Dec 23, 2005
  5. Tang Heng
    Replies:
    1
    Views:
    712
    Bob Barrows
    Aug 26, 2009
Loading...

Share This Page