Why are config transforms not applied when I manua

2019-07-25 00:15发布

I have a console application that I am deploying to Azure as a Web Job. I do this manually from Visual Studio 2015 by right-clicking the project and choosing "Publish as Azure WebJob".

I am now at a point where I need to deploy this app to several different environments (ex: dev, test, prod etc). In each environment the console app needs to run with different config settings.

To get this done, I've installed Slow Cheetah v2.5.48 and setup multiple config transform files - one for each environment.

I've also created dedicated publish profiles in my project - one for each environment - and I've made sure the profile names match the names of the config transform files.

When I manually publish via the Publish wizard in VS (as described above), I find that the config transforms are not applied. Instead, the "base" .config file are present on the target app service.

Why are the transforms not applied when publishing this way and how can I fix that?

2条回答
我只想做你的唯一
2楼-- · 2019-07-25 00:37

I would suggest you try with:

< xdt:Transform="Replace"> 
查看更多
我只想做你的唯一
3楼-- · 2019-07-25 00:39

According to your description, I suggest you could firstly check you have already build configuration called "dev" ,” test” like below.

enter image description here

Then I suggest you could check you have a right app config file in your project like below.

enter image description here

At last, you could make sure you have select the right build configuration.

enter image description here

Besides, I suggest you could open your .csproj file and ensure that the App.dev.config tag’s IsTransformFile is true.

<None Include="App.dev.config">
      <DependentUpon>App.config</DependentUpon>
      <IsTransformFile>True</IsTransformFile>
    </None>
查看更多
登录 后发表回答