Monday, March 26, 2012

web.config parameters inside compiled ClassLibrary

Hi folks,

I've created a class library, compiled as a .DLL-file to support my
ASP.NET webapplication. My .NET-application has some parameters (ie.
SQL connection string) stored in the web.config file. But I havent't
been able yet to use these parameters inside the class library ?

ConfigurationSettings.AppSettings() is not recognized, so I can't
compile the DLL with it...

Is it possible to retrieve these parameters from web.config from
inside a class library ?

Thx in advance!
Kind regards
MathewYou may just need to Add Reference to System.Configuration in the class
library, and then use the ConfigurationManager.AppSettings syntax.

"Lupus" <mathieu.maes@.gmail.comwrote in message
news:1179497520.860947.269790@.q75g2000hsh.googlegr oups.com...

Quote:

Originally Posted by

Hi folks,
>
I've created a class library, compiled as a .DLL-file to support my
ASP.NET webapplication. My .NET-application has some parameters (ie.
SQL connection string) stored in the web.config file. But I havent't
been able yet to use these parameters inside the class library ?
>
ConfigurationSettings.AppSettings() is not recognized, so I can't
compile the DLL with it...
>
Is it possible to retrieve these parameters from web.config from
inside a class library ?
>
>
Thx in advance!
Kind regards
Mathew
>

0 comments:

Post a Comment