I have a class library that contains a valid connectionString inside the app.config. Inside that class library I want to use it with
ConfigurationManager.ConnectionStrings["NAME"].ConnectionString
My ASP.net 4.0 framework application references that DDL and retrieves data from it. I want create a Entity Framework 4 DataContext within my DDL with the ConnectionString from the App.config. (I do not want to pass the connectionString from my ASP.net application in every single method. (I'm using ObjectDataSources))
However, this line inside my DLL throws a NullReferenceException.
ConfigurationManager.ConnectionStrings["NAME"].ConnectionString
How can I fix this issue?