Impersonation when calling com dll

  • Thread starter Andreas Bergmeier
  • Start date
A

Andreas Bergmeier

Hi.
There's a problem in asp.net I didn't find any satisfying anwser to yet.
We're using asp.net to generate a weblayout similar to our windows
clients. Thus we use a com dll which contains our application logic.
So far we have no problem.
Our Problem arises because we try to load configuration data (ini files)
in the dll. Problem is that these files don't necessarily rely on the
same machine the iis is installed on (thus it would be done by giving
the machine account read rights).
The problem we're facing is that one can enable impersonation for the
asp.net process - but unfortunately the dll is executed in another context.
As far as I analysed the problem the dll is executed using the
processModel in the machine.config file which might certainly have been
the easiest solution but in the other hand rebooting the webserver and
having then all com dlls executed using this context is not really an
option.
So my question is whether it is possible to define a certain user for
this one dll to execute. Or is there some way to impersonate the dll
with the same account as asp.net?

Thanks
Andreas
 
B

Bruce Johnson

You might want to take a look at deploying your COM DLL
into COM+. By creating a package for it through
Component Manager, it is possible to specify the identity
underwhich the DLL will be executed. There is
(generally) nothing special that needs to be done with
the DLL nor with the calling code. Performance is
impacted slightly, but that can be improved by pooling
the components (if the component is truly stateless).
But most important, the DLL can run as a different user
id.

Hope this help.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top