简体   繁体   English

用于web.config和app.config的单个NuGet转换文件

[英]Single NuGet transformation file for web.config and app.config

NuGet has this nice feature of transforming configurations , which is widely used mostly for transformations in web.config or app.config . NuGet具有转换配置的这个很好的功能,它主要用于web.configapp.config转换。

Now in my scenario, I want to update the main config, no matter whether it's web or app , but I would also like to have just a single source of truth , eg, just one file for install and uninstall in the package file. 现在在我的场景中,我想更新配置,无论是web还是app ,但我也希望只有一个事实来源 ,例如,只有一个文件可以在包文件中进行安装和卸载。

Is that possible somehow? 这有可能吗? Any best practice? 任何最佳做法?

You can just copy and rename the file before building a package. 您可以在构建程序包之前复制和重命名该文件。 Of course, you should make some kind of a script for this task. 当然,你应该为这个任务制作某种脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM