sayedihashimi / slow-cheetah

XML Transforms for app.config and other XML files
Other
242 stars 54 forks source link

Slowcheetah and Microsoft.Net.HttpClient are not working together #100

Closed ghost closed 7 years ago

ghost commented 11 years ago

Hello Sayed,

I have finally found the problem we were discussing to my problem here on SO

(Actually it is not working in VS)

Here are the steps to reproduce the bug... Open VS...

  1. Create an empty solution
  2. Add a class project
  3. Add Microsoft.Net.HttpClient Nuget packages
  4. Add config file
  5. Right click app.config and click Add Transform
  6. Edit app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <clear/>
  </appSettings>
</configuration>
  1. Edit app.debug.config
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations 
     see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <appSettings>
    <add key="key1" value="val1" xdt:Transform="Insert" />
  </appSettings>
</configuration>
  1. Add SlowCheetah Nuget Package
  2. Build in debug see config files in bin/debug dir
Below is app.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <clear/>
    <add key="key1" value="val1"/>
  </appSettings>
</configuration>
Below is TestClass.dll.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <clear />
  </appSettings>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.13.0" newVersion="2.2.13.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.13.0" newVersion="4.2.13.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
sayedihashimi commented 11 years ago

I have just released 2.5.7 and altered how app.config is handled. I think it may fix this problem as well. For existing projects you can just upgrade the nuget package with.

install-package slowcheetah

And for new projects, update the extension from the gallery (http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5) before invoking Add Transform.

Can you let me know if you are still facing the issue after the update?

ghost commented 11 years ago

Hi Sayed,

I have just updated my test solution with this and it works fine! Thanks.

FYI it works fine with Microsoft.Bcl.Build 1.0.10