Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use the <a href="http://msdn.microsoft.com/de-de/library/dd465326" rel="nofollow">"XML-Document-Transform Syntax"</a> Usually, this syntax ist meant for use within web projects but you can tweak it for usage in all kind of projects.</p> <p>You have to modify your project file (e.g. .csproj) by adding/updating the TransformXml-Task. In the example below, the transformation is executed during comilation by appliying the transformation on an App.config. As you can see, the task referes to the <em>$(Configuration)</em> variable, so the transformation commands are stored e.g. in an App.DEBUG.config or App.RELEASE.config. You can change this to any msbuild variable you like. If I remember correctly it was <em>$(COMPUTERNAME)</em> so you have to place your transformation into an App.MyMachineName.config.</p> <pre><code>&lt;UsingTask TaskName="TransformXml" AssemblyFile="C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/&gt; &lt;Target Name="AfterBuild"&gt; &lt;!-- use App.$(COMPUTERNAME).config for specific machine configuration --&gt; &lt;TransformXml Source="App.config" Condition="Exists('App.$(Configuration).config')" Transform="App.$(Configuration).config" Destination="$(OutDir)$(AssemblyName).dll.config"/&gt; &lt;/Target&gt; </code></pre> <p>A full description is available at a <a href="http://flurfunk.sdx-ag.de/2011/05/connection-strings-fur-test-win-und.html" rel="nofollow">german blog</a>.</p> <p>An that`s what you machine specific configuration looks like:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!-- "App.MyMachineName.config" - File name corresponds to the transformation task --&gt; &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt; &lt;connectionStrings&gt; &lt;add name="MyDbConnection" connectionString="Data Source=MyServer;Initial Catalog=MyDb;" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt; &lt;/connectionStrings&gt; &lt;/configuration&gt; </code></pre> <p>Alternatively, you may use an <a href="http://mint.litemedia.se/2010/01/29/transforming-an-app-config-file/" rel="nofollow">XSL Syntax</a></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.
    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