I have a regular ATL COM object which works fine in my ASP.Net page unless...

Discussion in 'ASP .Net' started by WTH, Nov 2, 2004.

  1. WTH

    WTH Guest

    ....I call a method on it which trys to read the registry. I can
    open/close/manipulate databases just fine but the registry? Bang,
    exception...

    The object works fine from a regular C# windows application, a VB .Net app,
    or an unmanaged C++ app.

    The weird thing is, this older COM object I have which was written by
    someone else reads the registry just fine and I can't see any differences
    between the two projects to account for this. Is there some 'com object
    permissions' place? They both are being instantiated by IIS and (I assume)
    running as the user 'Network Service.'

    WTH
     
    WTH, Nov 2, 2004
    #1
    1. Advertising

  2. This is a permissions issue. The ASP.NET application likely runs under a
    specific account (ASPNET or NETWORK SERVICE) that doesn't have access to the
    registry. If this is a DLL object, it will inherit the user context.

    If you can't change permissions you will have a tough time dealing with
    this. One thing you can do is move the page to a different folder, and set
    the folder up to use Impersonation in web.config. Then change the access to
    the page to a user that would have rights and that works.

    You can also change the registry permissions for the key/keys you're writing
    to to allow NETWORK SERVICE.


    +++ Rick ---

    --

    Rick Strahl
    West Wind Technologies
    http://www.west-wind.com/
    http://www.west-wind.com/weblog/
    http://www.west-wind.com/wwThreads/
    ----------------------------------
    Making waves on the Web


    "WTH" <> wrote in message
    news:...
    > ...I call a method on it which trys to read the registry. I can
    > open/close/manipulate databases just fine but the registry? Bang,
    > exception...
    >
    > The object works fine from a regular C# windows application, a VB .Net

    app,
    > or an unmanaged C++ app.
    >
    > The weird thing is, this older COM object I have which was written by
    > someone else reads the registry just fine and I can't see any differences
    > between the two projects to account for this. Is there some 'com object
    > permissions' place? They both are being instantiated by IIS and (I

    assume)
    > running as the user 'Network Service.'
    >
    > WTH
    >
    >
     
    Rick Strahl [MVP], Nov 2, 2004
    #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. Replies:
    14
    Views:
    518
    Jim Langston
    Aug 22, 2006
  2. Mufasa
    Replies:
    7
    Views:
    375
    Mufasa
    Jun 11, 2007
  3. Gábor SEBESTYÉN

    Unless unless

    Gábor SEBESTYÉN, Jun 17, 2005, in forum: Ruby
    Replies:
    3
    Views:
    161
    Gábor SEBESTYÉN
    Jun 17, 2005
  4. Michael Champagne
    Replies:
    4
    Views:
    352
    Matt Kruse
    Apr 20, 2004
  5. Fox
    Replies:
    5
    Views:
    112
Loading...

Share This Page