Possible to read aspx AppSettings from a COM+ server package?

  • Thread starter Thread starter Jim Bancroft
  • Start date Start date
J

Jim Bancroft

The answer's probably "no," but no harm in asking: Is it possible for a
serviced component, running in a COM+ server package, to read the
AppSettings of an aspx page that calls it?

Here's an example of what I'm dealing with. If I put my serviced component
in a COM+ library package and call it from an aspx page then the component
can make calls like this with no problem:

string ConnString =
ConfigurationSettings.AppSettings["ConnString"].ToString();

However, the same component in a COM+ server package is unable to find any
such AppSetting. It makes sense, given the component is now running outside
the webserver process, but I was wondering if there was a well-known
workaround (or kludge) that would still give me access to the web
application's configuration settings? Thanks in advance for your
reccomendations and tips.

-Jim
 
directly, no, because the Application settings are only available within
that appdomain's context. If you know where the file is, though, there's no
reason you can't read from that.

oh...here's an idea......

Use the config file's location in the COM+ component's constructor string
 
Thanks, David. I'll look into your suggestion.

Oh, and while I'm at it....would anyone know whether it's possible for one
AppDomain to read another's ConfigurationSettings? If my COM+ app could get
ahold of the webserver's info that might solve this problem too, though I
have no idea how feasible this is. Thanks again.

-Jim
 
Back
Top