title: VSTO Debug version fine, Installed version doesn't read app.config
body: <p>I have a VSTO Excel 2007 add-in that should read connectionstrings from the app.config file, and then let the user decide which database to connect to. This works fine when I debug it, but when I run the deployed version (done with Windows Installer) the connectionstrings aren't read at all. I have added the primary outputs from all the projects to the setup project. 
  The app.config file is in the ExcelAddIn project, but not under the Excel heading. The class that manages the connectionstrings is in another project.</p>
  
  <p>Here is my app.config file:</p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;clear/&gt;
      &lt;add name="MyEntities" connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/SymModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=myServer;initial catalog=myDB;persist security info=True;user id=myUser;password=myPassword;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient"/&gt;
    &lt;/connectionStrings&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="v11.0"/&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
    &lt;/entityFramework&gt;
  &lt;startup&gt;&lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;&lt;/startup&gt;&lt;/configuration&gt;
  </code></pre>
  
  <p>I use the following to get to the connectionstrings:</p>
  
  <pre><code>System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
          ConnectionStringsSection csSection = config.ConnectionStrings;
  </code></pre>
  
  <p>I have tried to add the ExcelAddin.dll.config file to the setup project's folder in which the Release folder and .proj file are. I have set the app.config file's 'Copy to Output Directory' property to 'Copy always' and the Build Action property to 'Content'. </p>
  
  <p>Is there something worng with my app.config file, or why is it not picked up (the connectionstrings are not loaded into csSection) after I've run the installer?</p>