I’m creating a class library that will be used in a web application. One of the things that happens in one of the assembly classes is that it hits a database. Normally, when I do this from a service, the connection string gets extracted from the web.config file. With the class library, I’m not so sure how that’s going to work the same way. Any suggestions?
Right now, I tried putting my normal config call in the assembly:
protected readonly string _utiConnStr =
System.Web.Configuration.WebConfigurationManager.ConnectionStrings["UTI"].ConnectionString;
It pukes, saying “Object reference not set to an instance of an object.”
For instance if I want mail settings: