相关疑难解决方法(0)

web.config文件从命令行转换

我有两个目标构建环境; 发布和分期.Web.config看起来像这样:

<system.web>     
    <authentication mode="Windows">
    </authentication>

    <authorization>
        <deny users="?" />
    </authorization>
</system.web>
Run Code Online (Sandbox Code Playgroud)

我想通过构建到暂存配置来转换它:Web.Staging.config

<system.web>     
    <authentication mode="Windows">
    </authentication>

    <authorization xdt:Transform="Replace">
        <deny users="?" />
        <allow roles="StagingRoles" />
        <deny users="*" />
    </authorization>
</system.web>
Run Code Online (Sandbox Code Playgroud)

我从命令行构建如下:

msbuild buildscript.build /p:Configuration=Staging
Run Code Online (Sandbox Code Playgroud)

在构建之后,我没有看到在构建工件文件夹中转换的web.config文件.这里有什么问题吗?

谢谢

msbuild

36
推荐指数
3
解决办法
2万
查看次数

TFS 2012没有将已转换的Web.Config复制到_PublishedWebsite

我有一个带有配置转换的Web项目.

在我的本地机器上,当项目构建时,转换工作正常.

但是,我的项目被推送到TFS并在那里构建,配置文件在主drop文件夹中转换; 但是,_PublishedWebsites中的版本是原始的,未转换的版本.

这在使用Octopack时会引起问题,因为它将_PublishedWebsites \文件夹中的所有内容打包进行部署,因此,我在部署中获得了未转换的文件

有没有办法在推送到_PublishedWebsites之前使TFS转换配置文件

编辑
我们正在使用TFS 2012

msbuild tfs web-config tfs2012 octopus-deploy

2
推荐指数
1
解决办法
1129
查看次数

标签 统计

msbuild ×2

octopus-deploy ×1

tfs ×1

tfs2012 ×1

web-config ×1