Hi,
I have a class in an assembly that references a value in web.config
like this:
<appSettings>
<add key="mykey" value="myvalue"/>
</appSettings>
string temp = System.Configuration.ConfigurationSettings.AppSett ings.Get("mykey");
This call works properly as is. However, if I call this class from
another assembly (by placing the assembly containing this class in the
calling assembly's references directory), the call fails with a
NullReferenceException. I can reference everything else in the
imported assembly, without any trouble, as you might expect.
It is almost as if an imported assembly can not read its own
web.config file.
I can abstract the values from out of the web.config and place them in
an external xml file, but I would rather not do this. I would prefer
to use the web.config. Any suggestions?
Thanks in advance,
Torrance S.
Env:
..NET IDE 2002 (v 7.0.9466)
..NET Framework 1.0 (v. 1.0.3705)
C# Web Project on W2k Pro