Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with app.config transformation upon installing on new solution
    text
    copied!<p>I have a package which applies app.config transformations upon project. Transform file looks like this</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="handlerId" value="$assemblyname$"/&gt; &lt;!--populate from project params--&gt; &lt;--other params--&gt; &lt;/appSettings&gt; &lt;/configuration&gt; </code></pre> <p>The case is: add package to a new project with no app.config, manually update app.config in project, and then update package.</p> <p>If I include app.config.transform to my package nuget creates app.config in project, but if i change value of one of parameters and update/reinstall package it creates copy of that parameter with value of package instead of skipping it. </p> <p>For example: Installed package upon clean project</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="handlerId" value="MyApp"/&gt; &lt;/appSettings&gt; &lt;/configuration&gt; </code></pre> <p>Then changed handlerId value to <code>MyApp1</code> and update package. The result of transformation is</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="handlerId" value="MyApp1"/&gt; &lt;add key="handlerId" value="MyApp"/&gt; &lt;!--shouldn't appear!--&gt; &lt;/appSettings&gt; &lt;/configuration&gt; </code></pre> <p>I tried to use xdt transformations instead. They work great upon package updating or installing package on project with app.config, but if there is no app.config nuget doesn't create it.</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