I have two solutions, one is a class library and the other is a web application, and I want to get the connection string from the web.config file to the class library as I am developing a custom membership provider. I am using Framework 4.0 and MS Visual Studio 2010.
Thanks
You can put the configuration settings for any library in the main web.config. It's easy!
Connection strings are especially easy. Just add your connection string to the
connectionstrings
section with the same name it has in the library's app.config, and you're done!To add configuration settings, at the top of your web config, find the
applicationSettings
section, and add your section's info. Note: be sure to set your library's settings access modifier to "Public". You can do this in the Properties ui.Then, add the section under
applicationSettings
.