c# - Can't get to work SlowCheeta -
i'm developing wpf application on vs 2017 community.
i've download slowcheeta,
app.debug.config
<?xml version="1.0" encoding="utf-8" ?> <!-- more information on using transformations see web.config examples @ http://go.microsoft.com/fwlink/?linkid=214134. --> <configuration xmlns:xdt="http://schemas.microsoft.com/xml-document-transform"> <system.diagnostics> <trace autoflush="true" indentsize="4"> <listeners> <add name="mylistener" type="system.diagnostics.textwritertracelistener" initializedata="application.log" /> <remove name="default" /> </listeners> </trace> </system.diagnostics> </configuration> app.release.config
<?xml version="1.0" encoding="utf-8" ?> <!-- more information on using transformations see web.config examples @ http://go.microsoft.com/fwlink/?linkid=214134. --> <configuration xmlns:xdt="http://schemas.microsoft.com/xml-document-transform"> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5.2"/> </startup> </configuration> now, whatever choose "debug" or "release", nothing changes app.config. furthermore, clicking preview transform both files show me app.config original content. wrong ?
you need enable transforms on config file. right click on project, select unload project. right click again select edit xxx.csproj.
scroll bottom of xml file.
it should like:
<target name="ensurenugetpackagebuildimports" beforetargets="prepareforbuild"> <propertygroup> <errortext>this project references nuget package(s) missing on computer. enable nuget package restore download them. more information, see http://go.microsoft.com/fwlink/?linkid=322105. missing file {0}.</errortext> </propertygroup> <error condition="!exists('$(solutiondir)\.nuget\nuget.targets')" text="$([system.string]::format('$(errortext)', '$(solutiondir)\.nuget\nuget.targets'))" /> <error condition="!exists('..\packages\slowcheetah.2.5.48\build\slowcheetah.targets')" text="$([system.string]::format('$(errortext)', '..\packages\slowcheetah.2.5.48\build\slowcheetah.targets'))" /> <error condition="!exists('..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets')" text="$([system.string]::format('$(errortext)', '..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets'))" /> </target> <target name="beforebuild"> </target> <target name="afterbuild"> </target> <import project="$(slowcheetahtargets)" condition="exists('$(slowcheetahtargets)')" label="slowcheetah" /> <import project="..\packages\slowcheetah.2.5.48\build\slowcheetah.targets" condition="exists('..\packages\slowcheetah.2.5.48\build\slowcheetah.targets')" /> <import project="..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets" condition="exists('..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets')" /> insert following xml:
<target name="beforebuild"> <transformxml source="app.config" transform="app.$(configuration).config" destination="app.config" /> </target> so looks like
<import project="$(solutiondir)\.nuget\nuget.targets" condition="exists('$(solutiondir)\.nuget\nuget.targets')" /> <target name="ensurenugetpackagebuildimports" beforetargets="prepareforbuild"> <propertygroup> <errortext>this project references nuget package(s) missing on computer. enable nuget package restore download them. more information, see http://go.microsoft.com/fwlink/?linkid=322105. missing file {0}.</errortext> </propertygroup> <error condition="!exists('$(solutiondir)\.nuget\nuget.targets')" text="$([system.string]::format('$(errortext)', '$(solutiondir)\.nuget\nuget.targets'))" /> <error condition="!exists('..\packages\slowcheetah.2.5.48\build\slowcheetah.targets')" text="$([system.string]::format('$(errortext)', '..\packages\slowcheetah.2.5.48\build\slowcheetah.targets'))" /> <error condition="!exists('..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets')" text="$([system.string]::format('$(errortext)', '..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets'))" /> </target> <target name="beforebuild"> <transformxml source="app.config" transform="app.$(configuration).config" destination="app.config" /> </target> <target name="afterbuild"> </target> <import project="$(slowcheetahtargets)" condition="exists('$(slowcheetahtargets)')" label="slowcheetah" /> <import project="..\packages\slowcheetah.2.5.48\build\slowcheetah.targets" condition="exists('..\packages\slowcheetah.2.5.48\build\slowcheetah.targets')" /> <import project="..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets" condition="exists('..\packages\buildwebcompiler.1.11.359\build\buildwebcompiler.targets')" /> right click select reload project. rebuild.
also ensure config files nested correctly, should this:
<content include="app.config"> <subtype>designer</subtype> </content> <content include="app.debug.config"> <dependentupon>app.config</dependentupon> </content> <content include="app.release.config"> <dependentupon>app.config</dependentupon> </content>
Comments
Post a Comment