0

No connection string named 'MarketingEntities' could be found in the application config file

Error

All the googling in the world came up with solutions that dont work for me.

  1. Its a single project application, there is no MyApp.Repository or anything else, just MyApp, so the solution to set the UI project as startup will not work for me.

  2. Connection is in my App.config (there is no web.config) enter image description here

  3. Ive deleted both bin and obj folders, did a clean. cleared out temp (via ccleaner). Running the app works, no problem. Normally, id ignore this and move on but in this case, I cant because I need to design something....

What do?!

E: The code that calls the settings file

public partial class MarketingEntities : DbContext
{
    public MarketingEntities() : base("name=MarketingEntities")
    {
    }
}
highboi
  • 673
  • 7
  • 28
  • Try `add key` instead of `add name` edit: can you show us the code you're using to retrieve the setting? – Tom F Feb 13 '18 at 22:04
  • my code to retrieve the settings? im not using any per-say. im using the default generated code from EF6. using `key` instead, same results. app runs, cant design. and now the config file says `key attribute cannot be used` – highboi Feb 13 '18 at 22:12
  • 2
    https://stackoverflow.com/questions/12622408/no-connection-string-named-myentities-could-be-found-in-the-application-config this might solve your issue – Tom F Feb 13 '18 at 22:14
  • 3
    Please don't post screenshots. Include the error message and the app.config as text, it is just short enough. – Sentry Feb 13 '18 at 22:15
  • @tom which one? those answers are points 1 and 2 in my question – highboi Feb 13 '18 at 22:18
  • @highboi SO posts (answers especially) are meant to help all future visitors. Pictures dont work in a Google search. Once in a while they are called for illustrate a UI issue, but not as a substitute for typing in your error text – Ňɏssa Pøngjǣrdenlarp Feb 13 '18 at 22:21
  • try `public MarketingEntities() :base("MarketingEntities")` – rene Feb 13 '18 at 22:40

0 Answers0