Different application settings depending on configuration mode

后端 未结 6 1891
生来不讨喜
生来不讨喜 2020-12-08 05:15

Is anyone aware of a way that I can set application (or user) level settings in a .Net application that are conditional on the applications current development mode? IE: Deb

6条回答
  •  伪装坚强ぢ
    2020-12-08 05:49

    I had a similar problem to solve and ended up using the XDT (web.config) transform engine, that was already suggested in the answer from ne1410s that can be found here: https://stackoverflow.com/a/27546685/410906

    But instead of doing it manually as described in his link I used this plugin: https://visualstudiogallery.msdn.microsoft.com/579d3a78-3bdd-497c-bc21-aa6e6abbc859

    The plugin is only helping to setup the configuration, it's not needed to build and the solution can be built on other machines or on a build server without the plugin or any other tools being required.

提交回复
热议问题