ConfigurationManager question

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!
 
S

Stefan

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
 
L

la_dev

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

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

Top