自定义发布配置文件保持默认为调试配置设置

时间:2019-04-26 14:13:59

标签: asp.net-mvc web-config publish pubxml

项目需要2个配置Debug,UAT和Release。调试和发布工作正常,并且是默认的项目配置,但是我需要第三个(UAT)。

问题是,当我发布在设置中选择了UAT配置的项目时,它仍然使用Debug值。

debug / UAT / release配置示例:

$ heroku config:set RAILS_MASTER_KEY=<master key>

在.pubxml中查找发布配置文件,UAT拥有<?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <appSettings> <add key="organizationUrl" value="https://charisgrantsapsdev.crm4.dynamics.com" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" /> </appSettings> <connectionStrings> <add name="Conn" connectionString="Data Source=etc" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> </connectionStrings> <system.web> </system.web> </configuration> PreSource Path的Dev配置连接字符串详细信息,而对于debug.pubxl,则为空白,而release.pubxml没有完全具有PublishDatabaseSettings < Objects < ObjectGroup < Object部分。

在测试前端,显示UAT已发布站点的appSetting,将显示在调试配置中指定的值。

0 个答案:

没有答案