ASP.NET not executing interop functions

Discussion in 'ASP .Net' started by =?Utf-8?B?SmFzIE1hbmdoZXJh?=, Apr 5, 2005.

  1. Hello everyone, Im having a rather strange problem with my custom ASP.NET
    application. After deploying the application on a .NET v1.1 computer, the
    first time the application is launched it can call an external interop and
    excute commands with no problems. However, when the same system is restarted
    and my application is relauched the COM commands do not function (asp &
    managed code still works fine).

    When I alter the permissions of any file in my application's web folder the
    COM interop functions begin working again. Sometimes I open up my web config
    add a blank space to the end of the file, save & exit, and voila the COM
    interop works again (temporarily - until the next restart).

    What is going on, is the CLR not loading the COM interop correctly? How do I
    resolve this issue?
     
    =?Utf-8?B?SmFzIE1hbmdoZXJh?=, Apr 5, 2005
    #1
    1. Advertising

  2. Hi Jas,

    Your best bet likely will be to stick the COM component into a COM+
    Application and then assign an Impersonation to the COM+ Application.

    The problem most likely is that the ASP.NET account (ASPNET or NETWORK
    SERVICE by default) - which is doesn't have rights to access the DLL or
    access what ever the DLL needs to have access to. IF you don't use COM+ the
    DLL just inherits the ASP.NET security token.

    So the two choices are: Use COM+ as described or lower the security to give
    the ASP.NET account the rights it needs to access the DLL and anything the
    DLL accesses. If at all possible the former is probably the better approach.
    <g>

    +++ Rick ---

    --

    Rick Strahl
    West Wind Technologies
    www.west-wind.com
    www.west-wind.com/weblog



    "Jas Manghera" <> wrote in message
    news:...
    > Hello everyone, Im having a rather strange problem with my custom ASP.NET
    > application. After deploying the application on a .NET v1.1 computer, the
    > first time the application is launched it can call an external interop and
    > excute commands with no problems. However, when the same system is
    > restarted
    > and my application is relauched the COM commands do not function (asp &
    > managed code still works fine).
    >
    > When I alter the permissions of any file in my application's web folder
    > the
    > COM interop functions begin working again. Sometimes I open up my web
    > config
    > add a blank space to the end of the file, save & exit, and voila the COM
    > interop works again (temporarily - until the next restart).
    >
    > What is going on, is the CLR not loading the COM interop correctly? How do
    > I
    > resolve this issue?
    >
    >
     
    Rick Strahl [MVP], Apr 6, 2005
    #2
    1. Advertising

  3. I managed a work-around by giving the ASP.NET account increased security
    priveledges, thanks for your help Rick.

    "Rick Strahl [MVP]" wrote:

    > Hi Jas,
    >
    > Your best bet likely will be to stick the COM component into a COM+
    > Application and then assign an Impersonation to the COM+ Application.
    >
    > The problem most likely is that the ASP.NET account (ASPNET or NETWORK
    > SERVICE by default) - which is doesn't have rights to access the DLL or
    > access what ever the DLL needs to have access to. IF you don't use COM+ the
    > DLL just inherits the ASP.NET security token.
    >
    > So the two choices are: Use COM+ as described or lower the security to give
    > the ASP.NET account the rights it needs to access the DLL and anything the
    > DLL accesses. If at all possible the former is probably the better approach.
    > <g>
    >
    > +++ Rick ---
    >
    > --
    >
    > Rick Strahl
    > West Wind Technologies
    > www.west-wind.com
    > www.west-wind.com/weblog
    >
    >
    >
    > "Jas Manghera" <> wrote in message
    > news:...
    > > Hello everyone, Im having a rather strange problem with my custom ASP.NET
    > > application. After deploying the application on a .NET v1.1 computer, the
    > > first time the application is launched it can call an external interop and
    > > excute commands with no problems. However, when the same system is
    > > restarted
    > > and my application is relauched the COM commands do not function (asp &
    > > managed code still works fine).
    > >
    > > When I alter the permissions of any file in my application's web folder
    > > the
    > > COM interop functions begin working again. Sometimes I open up my web
    > > config
    > > add a blank space to the end of the file, save & exit, and voila the COM
    > > interop works again (temporarily - until the next restart).
    > >
    > > What is going on, is the CLR not loading the COM interop correctly? How do
    > > I
    > > resolve this issue?
    > >
    > >

    >
    >
    >
     
    =?Utf-8?B?SmFzIE1hbmdoZXJh?=, Apr 6, 2005
    #3
    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. Stefan Barlow

    COM interop from ASP.NET

    Stefan Barlow, Aug 4, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    472
    Stefan Barlow
    Aug 4, 2003
  2. Lars-Erik Aabech
    Replies:
    14
    Views:
    9,051
    hmkjr
    Jul 10, 2009
  3. Patrick
    Replies:
    2
    Views:
    661
    Steven Cheng[MSFT]
    Oct 1, 2004
  4. Kristof Thys

    ASP.net webservice interop with c++ dll

    Kristof Thys, Sep 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    476
    Kristof Thys
    Sep 23, 2004
  5. Jon Hinkle

    .NET Interop with Win32 dll not completely working

    Jon Hinkle, Oct 18, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    105
    Jon Hinkle
    Oct 18, 2004
Loading...

Share This Page