I\'m working with EF5 in a MVC 4 aspnet website. Locally, everything works just fine, but when I publish it to the IIS and try to enter, I get the error
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:
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!