The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
If you get the error above in your web browser it might be due to Visual studio 2010 not updating the web.config file.
Creating an Entity framework 2 multi tier (n-tier/ntier) aspnet mvc 2 solution in Visual studio 2010 wasn’t the next-next-next or just-follow-an-example I first thought.
The first try rendered a “The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.” message in the browser. There were mainly two answers through google:
1) create a Mydatalayer.dll.config and insert the connection string there
2) update the web.config and insert the connection string there
I tried them both to no avail. I knew my connection string was correct because I could use it through a test dll.
Finally I found out that the web.config file in the web project does not get copied to the output. It fooled me since I saw that there were 3 web config files (ordinary+debug+release) in the site.
Now I don’t dare to set the web.config in VS2010 to Copy-if-newer since the web.config already in the site has almost 80 rows already and I don’t want to overwrite it.
Updating the web.config in the site will save me for now. I will figure out how to do it the right way later.