Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use the configuration manager and define DEBUG, TEST, RELEASE as compile time constants. For configurations I use <a href="http://msdn.microsoft.com/en-us/library/dd465326.aspx" rel="nofollow">Web.config Transformation Syntax for Web Application Project Deployment</a> and would highly recommend using them.</p> <p>For example:</p> <pre><code>//web.config &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;connectionStrings&gt; &lt;add name="MyConnectionString" connectionString="Data Source=SqlServer\Sql2008; Initial Catalog=MyDB.Dev; Integrated Security=SSPI" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; &lt;add key="SomeAppSetting" value="DebugValue"/&gt; &lt;/configuration&gt; </code></pre> <p>Test transformation:</p> <pre><code>//web.Test.config &lt;?xml version="1.0"?&gt; &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt; &lt;connectionStrings&gt; &lt;add name="MyConnectionString" connectionString="Data Source=SqlServer\Sql2008; Initial Catalog=MyDB.Test; Integrated Security=SSPI" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt; &lt;/connectionStrings&gt; &lt;add key="SomeAppSetting" value="TestValue" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/&gt; &lt;/configuration&gt; </code></pre> <p>When I change my configuration from debug to test and rebuild/deploy my app now uses the transformation update in my <code>web.Test.config</code>. Extremely useful.</p> <p>You can build different configurations using the <a href="http://msdn.microsoft.com/en-us/library/t1hy4dhz%28v=VS.100%29.aspx" rel="nofollow">Configuration Manager Dialog Box</a>. At anytime you can right click on the web.config and select <em>Add Config Transformations</em> to have Visual Studio 2010 create the transformation config files automagically.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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