Applying web.config transformations locally

前端 未结 1 1147
深忆病人
深忆病人 2021-01-18 10:49

I have a transform for my web.config that currently works if I publish to Azure, but it\'s not working locally when I build/run. How can I go about \"Publishing\" locally s

相关标签:
1条回答
  • 2021-01-18 11:01

    It depends on which dev server you are using. As @Citronas said on this answer:

    It depends on how you debug. If you are using Cassini, afaik your web.config contents will be read regardless of the selected solution configuration (e.g. Debug or Release).

    If you are debugging with your local IIS, it depends on what you have set the path in the IIS to. If you have set it to your source code directory, you need to write your local settings into your web.config. If you publish your code into a local directory and set the IIS path accordingly, you can use web.config transforms. (You said, that your web.config transforms are working)

    You do not need to publish locally (even though you can do that, publish to local IIS then attach the debugger to the worker process of the application pool) since it is annoying. The easiest way is to simple have your debug settings in the web.config file and then apply transforms for your "publishable" environments.

    In short: do not use transforms for debug, only for publishing. Use the regular web.config to debug.

    0 讨论(0)
提交回复
热议问题