Impersonation when calling com dll

  • Thread starter Thread starter Andreas Bergmeier
  • Start date 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
 
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
 
Back
Top