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

W

WTH

....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
 
R

Rick Strahl [MVP]

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/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top