Note that there are some explanatory texts on larger screens.

plurals
  1. POSharePoint 2010 - Creating a supplemental web.config file
    text
    copied!<p>I'm currently developing a new feature for SharePoint 2010. Along with the deployment of my feature I would like to add some settings to the <code>&lt;appSettings/&gt;</code> section within my SharePoint applications web.config.</p> <p>I found some information on <a href="http://msdn.microsoft.com/en-us/library/ms439965.aspx" rel="nofollow noreferrer">MSDN</a> regarding adding supplemental .config files during deployment, but I have not been able to get this to work. This approach seemed the cleanest to me since I can have all my changes within a single file and have them deployed with the rest of my application. </p> <p>I've created a <code>webconfig.MyApp.xml</code> file as suggested in the documentation, deployed it to the <code>&lt;SharePoint 14 hive&gt;\Config</code> folder, but my changes are not being propagated to my applications web.config.</p> <p>Below is a sample snippet from my supplemental config file.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;actions&gt; &lt;add path="configuration/appSettings"&gt; &lt;add key="MyFeatureKey" value="MyFeatureValue" /&gt; &lt;/add&gt; &lt;/actions&gt; </code></pre> <p>I would like to avoid having to manually edit the web.config since those changes can easily be lost during SharePoint maintenance, etc.</p> <p>If you have any ideas on an alternate maintainable approach to deploying web.config changes, my ears are open.</p> <p><strong>UPDATE:</strong> The answers that have been given so far are great and I'm sure they will work. But I'm looking for a solution that can be packaged up within my single <code>WSP</code> and deployed without any additional steps required.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload