Why are config transforms not applied when I manually publish a console app as an Azure webjob?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 09:15:47

问题


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?


回答1:


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

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

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

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>



回答2:


I would suggest you try with:

< xdt:Transform="Replace"> 


来源:https://stackoverflow.com/questions/43225504/why-are-config-transforms-not-applied-when-i-manually-publish-a-console-app-as-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!