0

I'm getting an error that doesn't make any sense to me. I'm using Entity Framework 6.1.3, class first based upon existing database. When I created the DbContext class using EF I called it PrismSpecMap. There most certainly is a class by that name, and its a public class. (It is in a folder named Data; I don't know if that will make a difference or not.) I get an error message from Visual Studio 2013 saying, "No connection string named 'PrismSpecMap' could be found in the application config file." But that doesn't make sense; it is there, I've opened the app.config file and it's there. And what also doesn't make any sense is I can compile and run it on my dev box.

Why am I getting this error when it is in the app.config file? How do I "fix" whatever it is that's broken/not happy?

Rod
  • 4,107
  • 12
  • 57
  • 81
  • Post the relevant section of the app.config file and double check your spelling. – Brandon May 04 '15 at 17:09
  • Can you paste the connection string from the app config (with pw and username removed obv) ? Also what kind of startup project are you using? – Adam Diament May 04 '15 at 17:09
  • Check http://stackoverflow.com/questions/12622408/no-connection-string-named-myentities-could-be-found-in-the-application-config – jaypb May 04 '15 at 17:09
  • Here's the relevant code from the App.Config file: – Rod May 05 '15 at 17:31

1 Answers1

2

First check correctness of connectionstring name. Then check that connection string is added in a startup project. All others app.config or web.config files will be ignored. Whenever you have a few projects in the solution configuration file is used from main project.

Pawel Maga
  • 5,428
  • 3
  • 38
  • 62