Bug in Interop?

Discussion in 'ASP .Net Web Services' started by Michael, Oct 29, 2003.

  1. Michael

    Michael Guest

    Hi, we have a small web service that calls into some VB6
    com components. There is only one call to these
    components and this is done on a new thread in order to
    use impersonation. The problem is that on every other
    call into the Com components the aspnet_wp.exe throws an
    unhandled exception " 0xC0000005: Access violation
    reading location " and recycles itself.

    Has anyone else ran into this. Not sure what could be
    causing this. Any ideas?

    Also, releasecomobject is being called and even tried
    garbage collecting......

    Thanks for any insight....
    Michael, Oct 29, 2003
    #1
    1. Advertising

  2. Michael

    Chris Botha Guest

    Michael, you don't need a new thread for impersonation, switch off anonymous
    access to the web app and put
    <identity impersonate="true" />
    in your web.config file under the line <system.web> and use the main
    thread and see what it does (for sure VB6 com components are not thread
    safe, but it may be irrelevant in your case).

    "Michael" <> wrote in message
    news:0cbf01c39e76$f3dbe570$...
    >
    > Hi, we have a small web service that calls into some VB6
    > com components. There is only one call to these
    > components and this is done on a new thread in order to
    > use impersonation. The problem is that on every other
    > call into the Com components the aspnet_wp.exe throws an
    > unhandled exception " 0xC0000005: Access violation
    > reading location " and recycles itself.
    >
    > Has anyone else ran into this. Not sure what could be
    > causing this. Any ideas?
    >
    > Also, releasecomobject is being called and even tried
    > garbage collecting......
    >
    > Thanks for any insight....
    >
    Chris Botha, Oct 30, 2003
    #2
    1. Advertising

  3. Michael

    Guest Guest

    From what I have read you need to create a new thread in
    a web service when accessing Com components. This is not
    true when working with Asp.net. Only web services...

    >-----Original Message-----
    >Michael, you don't need a new thread for impersonation,

    switch off anonymous
    >access to the web app and put
    ><identity impersonate="true" />
    >in your web.config file under the line <system.web>

    and use the main
    >thread and see what it does (for sure VB6 com components

    are not thread
    >safe, but it may be irrelevant in your case).
    >
    >"Michael" <> wrote in message
    >news:0cbf01c39e76$f3dbe570$...
    >>
    >> Hi, we have a small web service that calls into some

    VB6
    >> com components. There is only one call to these
    >> components and this is done on a new thread in order

    to
    >> use impersonation. The problem is that on every other
    >> call into the Com components the aspnet_wp.exe throws

    an
    >> unhandled exception " 0xC0000005: Access violation
    >> reading location " and recycles itself.
    >>
    >> Has anyone else ran into this. Not sure what could be
    >> causing this. Any ideas?
    >>
    >> Also, releasecomobject is being called and even tried
    >> garbage collecting......
    >>
    >> Thanks for any insight....
    >>

    >
    >
    >.
    >
    Guest, Oct 30, 2003
    #3
  4. Michael

    Chris Botha Guest

    Hi.

    This is interesting. Can you remember where you read it? I'm asking,
    because I don't do it.

    Thanks.

    <> wrote in message
    news:0ac601c39ef2$66145a70$...
    >
    > From what I have read you need to create a new thread in
    > a web service when accessing Com components. This is not
    > true when working with Asp.net. Only web services...
    >
    > >-----Original Message-----
    > >Michael, you don't need a new thread for impersonation,

    > switch off anonymous
    > >access to the web app and put
    > ><identity impersonate="true" />
    > >in your web.config file under the line <system.web>

    > and use the main
    > >thread and see what it does (for sure VB6 com components

    > are not thread
    > >safe, but it may be irrelevant in your case).
    > >
    > >"Michael" <> wrote in message
    > >news:0cbf01c39e76$f3dbe570$...
    > >>
    > >> Hi, we have a small web service that calls into some

    > VB6
    > >> com components. There is only one call to these
    > >> components and this is done on a new thread in order

    > to
    > >> use impersonation. The problem is that on every other
    > >> call into the Com components the aspnet_wp.exe throws

    > an
    > >> unhandled exception " 0xC0000005: Access violation
    > >> reading location " and recycles itself.
    > >>
    > >> Has anyone else ran into this. Not sure what could be
    > >> causing this. Any ideas?
    > >>
    > >> Also, releasecomobject is being called and even tried
    > >> garbage collecting......
    > >>
    > >> Thanks for any insight....
    > >>

    > >
    > >
    > >.
    > >
    Chris Botha, Oct 30, 2003
    #4
  5. Michael

    Guest Guest

    We need our Com components to use a different user than
    the Aspnet account....

    see this microsoft article
    http://support.microsoft.com/default.aspx?scid=kb;en-
    us;325791


    >-----Original Message-----
    >Hi.
    >
    >This is interesting. Can you remember where you read

    it? I'm asking,
    >because I don't do it.
    >
    >Thanks.
    >
    ><> wrote in message
    >news:0ac601c39ef2$66145a70$...
    >>
    >> From what I have read you need to create a new thread

    in
    >> a web service when accessing Com components. This is

    not
    >> true when working with Asp.net. Only web services...
    >>
    >> >-----Original Message-----
    >> >Michael, you don't need a new thread for

    impersonation,
    >> switch off anonymous
    >> >access to the web app and put
    >> ><identity impersonate="true" />
    >> >in your web.config file under the line <system.web>

    >> and use the main
    >> >thread and see what it does (for sure VB6 com

    components
    >> are not thread
    >> >safe, but it may be irrelevant in your case).
    >> >
    >> >"Michael" <> wrote in message
    >> >news:0cbf01c39e76$f3dbe570$...
    >> >>
    >> >> Hi, we have a small web service that calls into some

    >> VB6
    >> >> com components. There is only one call to these
    >> >> components and this is done on a new thread in

    order
    >> to
    >> >> use impersonation. The problem is that on every

    other
    >> >> call into the Com components the aspnet_wp.exe

    throws
    >> an
    >> >> unhandled exception " 0xC0000005: Access violation
    >> >> reading location " and recycles itself.
    >> >>
    >> >> Has anyone else ran into this. Not sure what could

    be
    >> >> causing this. Any ideas?
    >> >>
    >> >> Also, releasecomobject is being called and even

    tried
    >> >> garbage collecting......
    >> >>
    >> >> Thanks for any insight....
    >> >>
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >
    Guest, Oct 30, 2003
    #5
  6. Michael

    Chris Botha Guest

    I had a look at the article, frightening.
    What I said in my first response above was you don't have to use a second
    thread in order to impersonate. I'm calling COM components with
    impersonation from the main thread, and it works - after reading the article
    I'm a bit nervous though. In any case, this is what I do
    (1) Take off anonymous access to the virtual directory (Internet Services
    Manager)
    (2) Make the following entry in the web.config file, under the line that
    says "<system.web>", put a line
    "<identity impersonate="true"/>"

    Now you should be able to call the WEB Service from IE already, however, if
    you use a Windows app that calls the service, then you may have to call
    myService.Credentials = new NetworkCredential(...) or use the
    DefaultCredentials.
    Note that you can also "hard-code" the UserName/Password in the web.config
    file, have a look at
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconimpersonation.asp

    Please let me know if this works, so I can shrug off the nervousness.


    <> wrote in message
    news:0ce401c39efe$abc45b40$...
    >
    > We need our Com components to use a different user than
    > the Aspnet account....
    >
    > see this microsoft article
    > http://support.microsoft.com/default.aspx?scid=kb;en-
    > us;325791
    >
    >
    > >-----Original Message-----
    > >Hi.
    > >
    > >This is interesting. Can you remember where you read

    > it? I'm asking,
    > >because I don't do it.
    > >
    > >Thanks.
    > >
    > ><> wrote in message
    > >news:0ac601c39ef2$66145a70$...
    > >>
    > >> From what I have read you need to create a new thread

    > in
    > >> a web service when accessing Com components. This is

    > not
    > >> true when working with Asp.net. Only web services...
    > >>
    > >> >-----Original Message-----
    > >> >Michael, you don't need a new thread for

    > impersonation,
    > >> switch off anonymous
    > >> >access to the web app and put
    > >> ><identity impersonate="true" />
    > >> >in your web.config file under the line <system.web>
    > >> and use the main
    > >> >thread and see what it does (for sure VB6 com

    > components
    > >> are not thread
    > >> >safe, but it may be irrelevant in your case).
    > >> >
    > >> >"Michael" <> wrote in message
    > >> >news:0cbf01c39e76$f3dbe570$...
    > >> >>
    > >> >> Hi, we have a small web service that calls into some
    > >> VB6
    > >> >> com components. There is only one call to these
    > >> >> components and this is done on a new thread in

    > order
    > >> to
    > >> >> use impersonation. The problem is that on every

    > other
    > >> >> call into the Com components the aspnet_wp.exe

    > throws
    > >> an
    > >> >> unhandled exception " 0xC0000005: Access violation
    > >> >> reading location " and recycles itself.
    > >> >>
    > >> >> Has anyone else ran into this. Not sure what could

    > be
    > >> >> causing this. Any ideas?
    > >> >>
    > >> >> Also, releasecomobject is being called and even

    > tried
    > >> >> garbage collecting......
    > >> >>
    > >> >> Thanks for any insight....
    > >> >>
    > >> >
    > >> >
    > >> >.
    > >> >

    > >
    > >
    > >.
    > >
    Chris Botha, Oct 30, 2003
    #6
    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. Brett Roy

    Tab Fails on TextBox using COM Interop

    Brett Roy, Sep 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    428
    Brett Roy
    Sep 29, 2003
  2. JerryP

    com interop C# VB6

    JerryP, Oct 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    618
    JerryP
    Oct 28, 2004
  3. Vishesh

    Excel interop

    Vishesh, Dec 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    862
  4. bracoute

    Microsoft Office Interop word dll

    bracoute, Jul 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,317
    anastasia
    Jul 5, 2003
  5. bracoute

    Interop saveAs html automation

    bracoute, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    538
    bracoute
    Jul 8, 2003
Loading...

Share This Page