ConfigurationManager question

  • Thread starter Thread starter la_dev
  • Start date Start date
L

la_dev

ok, here's my question. I have a class ConfigServer that has the
following method:

public string FindByKey(string key)
{
try
{
return ConfigurationManager.AppSettings[key].ToString();
}
catch (Exception ex)
{
return ex.Message;
}
}

I also have a config file named MyAppName.dll.config (same as the output
dll).

I have this dll installed in the gac and located in a specific folder on
my machine with the config file.

I want this application to basically be used by various other
applications to read in settings. When I reference the dll from an a
different solution, I get and call this method, I get "Object reference
not set to an instance of an object".

Any thoughts?

Thanks!
 
Hi,

This might be a stupid question but are you sure 'your various other
applications' are referencing your dll properly.

It also might be an issue of cross communication between app domains.

Happy Coding,

Stefan
C# GURU
www.DotNETovation.com

"You always have to look beyond the horizon and can never be complacent
-- God forbid we become complacent."

Jozef Straus
 
Yes, I am referencing the dll properly. It is in only one spot on my
machine. Thanks.
 
Back
Top