gpt4 book ai didi

.net - Visual Studio 发布选择错误的 web.config 转换

转载 作者:行者123 更新时间:2023-12-02 04:02:57 26 4
gpt4 key购买 nike

根据我读到的内容,只要您有一个与发布配置文件名称匹配的转换,就应该应用它,但对我来说情况并非如此。

发布个人资料

PublisProfiles
dev.pubxml
local.pubxml

变换

 Web.Config
Web.Debug.config
Web.local.config
Web.Release.config

当我使用本地配置发布时,我看到这个:

Transformed Web.config using  C:\...\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.

所以它使用Release.config ..我打开local.pubxml并尝试更改它

<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>

至:

<LastUsedBuildConfiguration>local</LastUsedBuildConfiguration>

但随后它使用 Web.Debug.config 转换。

除了一些转换后的属性之外,开发、发布、本地转换是相同的..

最佳答案

似乎是一个错误,因为我终于让它工作了:

  1. 删除 Web.Debug.config

  2. 发布本地(我的 Web.local.config 正在应用)

  3. 右键单击 Web.Config“添加配置转换”以返回 Web.Debug.config

  4. 确认转换仍然有效

关于.net - Visual Studio 发布选择错误的 web.config 转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22467031/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com