Q:

Why am I Getting a no connection Error when I Implement an Event? 

I am creating a desktop application using c# WinForms and Entity Framework.  I'm trying to decouple my view from the presenter with events and when I do it breaks something.  I get an error "No connection string named 'TipManagerDBEntities' could be found in the application config file" when I click on Form1.cs.  
I checked the App.config file to make sure the connection string is in there and I made sure the config file was loading up with the solution.  I've reset my repo to right before I made the event changes and everything works fine.  I then rewrite the event and it runs fine.  When I save and reopen the project I get the error.  When I debug the program it still runs fine but I can't seem to find the source of the error. 
This is the call stack for the error:
at System. Data. Entity. Internal. LazyInternalConnection.get_ConnectionHasModel()
at System. Data. Entity. Internal. LazyInternalContext. InitializeContext()
at System. Data. Entity. Internal. InternalContext. Initialize()
at System. Data. Entity. Internal. InternalContext. GetEntitySetAndBaseTypeForType(Type entityType)
at System. Data. Entity. Internal. Linq. InternalSet`1.Initialize()
at System. Data. Entity. Internal. Linq. InternalSet`1.get_InternalContext()
at System. Data. Entity. Infrastructure. DbQuery`1.System. Linq. IQueryable.get_Provider()
at System. Linq. Queryable. Sum[TSource](IQueryable`1 source, Expression`1 selector)
at TipManager. Services. Repository. GetSumOfDeposits() in C:\Users\Adam\source\repos\TipManager\Services\Repository.cs:line 15
at TipManager. Services. TipManagerServices.passSumTotalToModel() in C:\Users\Adam\source\repos\TipManager\Services\TipManagerServices.cs:line 22
at TipManager. Presenter. HomePresenter. DisplayTotal() in C:\Users\Adam\source\repos\TipManager\Presenter\HomePresenter.cs:line 34
at TipManager. Presenter. HomePresenter. OnHomeLoaded(Object sender, EventArgs e) in C:\Users\Adam\source\repos\TipManager\Presenter\HomePresenter.cs:line 56
at TipManager. UserControls. Home. Home_Load(Object sender, EventArgs e) in C:\Users\Adam\source\repos\TipManager\UserControls\Home.cs:line 40
at System. Windows. Forms. UserControl. OnLoad(EventArgs e)
at System. Windows. Forms. UserControl. OnCreateControl()
at System. Windows. Forms. Control. CreateControl(Boolean fIgnoreVisible)
at System. Windows. Forms. Control. CreateControl()
at System. Windows. Forms. Control. ControlCollection. Add(Control value)
at System. Windows. Forms. Form. ControlCollection. Add(Control value)
at System. Windows. Forms. Design. ControlDesigner. DesignerControlCollection. Add(Control c)

The App.config file containing the connection string:
<connectionStrings>
    <add name="TipManagerDBEntities" connectionString="metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System. Data. SqlClient;provider connection string=&quot;data source=DESKTOP-GNG12RP\SQLEXPRESS;initial catalog=TipManagerDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System. Data. EntityClient" />
  </connectionStrings>

The View with an IHome interface:
public partial class Home : UserControl, IHome
    {
        //private HomePresenter presenter;

        public Home()
        {
            InitializeComponent();
            new HomePresenter(this);

        }
        private void Home_Load(object sender, EventArgs e)
        {
            //presenter = new HomePresenter(this);
            //presenter. DisplayTotal();
            EventHandler handler = homeLoaded;
            handler?.Invoke(this, e);
        }

The Presenter:
class HomePresenter
{
    TipManagerModel tipManager = new TipManagerModel();

    TipManagerServices services;

    private IHome homeView;

    public HomePresenter(IHome view)
    {
        homeView = view;
        services = new TipManagerServices(tipManager);
        homeView.homeLoaded += new EventHandler(OnHomeLoaded);
    }

    public void OnHomeLoaded(object sender, EventArgs e)
    {
        DisplayTotal();
    }

Oddly enough everything is still working as expected but I get a big error page blocking my designer with the option to Ignore and Continue but I'd like to get to the root of the problem.  In the View when I use the commented out code to create and call the Presenter itself I don't get this error but when I use the event this happens every time.  Any idea what I'm doing wrong? 

A:

The event had nothing to do with the problem.  The connection string was the problem.  First, I copied the connection string from the app.config file, excluding the provider name part at the end and changed "&quot" with "'".  Then passed the string directly to the base constructor in the context file like so:
public partial class TipManagerDBEntities : DbContext
{
    public TipManagerDBEntities()
        : base(@"metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System. Data. SqlClient;provider connection string=';data source=DESKTOP-GNG12RP\SQLEXPRESS;initial catalog=TipManagerDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework';")
    {
    }

Honestly, I don't know exactly why this fixed the problem.  The program was still able to connect to the database and query data but you would get an error. 