Old question but it just happened to me for different reasons mentioned in the other answers, so I thought I'd share my findings.
In my case, the problem was how I defined my connection string entry in the app.config. I edited it directly in Notepad++
and I must have hit a shortcut, and minimized the entire string which I didn't spot, and started to get this error. This is how I was defined it:
<add name="MyDb" connectionstring="data source=MyServer;
initial catalog=MyDatabase;integrated security=true"
providername="System.Data.SqlClient" />
The second I changed the following parameters
connectionstring to connectionString
and
providername to providerName
Note: The problem was highlighted immediately In Visual Studio but clearly this isn't ideal if you're on a client site!