‘ConfigurationManager’ is not a member of ‘Configuration’
At the risk of appearing to be an idiot, I’m going to blog this so I don’t forget. Especially since it bit me twice *in the same project*. Oops.
In .NET 2.0, the old method of getting information from the app.config has been depreciated. The new method is:
ConfigurationManager.ConnectionStrings.Item(YourDB).ConnectionString
For this to work, though, you need to remember to add a reference to System.Configuration. This needs to be done for each project in the solution that uses it. Thankfully I figured out that last bit pretty quickly.
One Comment
- Daniel said: