【问题标题】:Azure DevOps Build - publish doesn't create .compiled files in bin folder on publishAzure DevOps Build - 发布时不会在 bin 文件夹中创建 .compiled 文件
【发布时间】:2019-05-24 16:48:42
【问题描述】:

我正在构建一个 Web 项目,并从 Azure-DevOps 构建管道创建一个已发布的包。

我遇到的问题是发布时没有在 bin 文件夹中获取 .compile 文件。当我从直接构建机器的 VS 2015 发布时(azure-DevOps 构建也在其上运行)我得到所有 .compile 文件。

我的 .pubxml 文件

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>False</EnableUpdateable>
    <DebugSymbols>True</DebugSymbols>
    <WDPMergeOption>CreateSeparateAssembly</WDPMergeOption>
    <UseFixedNames>True</UseFixedNames>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>E:\DevOps\agent\vsts-agent-win-x64-2.136.1\QAWeb_Artifacts</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
  </PropertyGroup>
</Project>

Azure-DevOps 管道中的任务配置

我在这里发现了同样的问题 - https://forums.asp.net/t/1984856.aspx 但没有得到答复。

请提出我在从 azure-DevOps 构建和发布网站时缺少的内容。

【问题讨论】:

  • 首先,不要对代理路径进行硬编码。使用诸如$(Build.SourcesDirectory) 之类的变量。在其他代理上运行或克隆构建定义时,硬编码路径将失败。
  • @DanielMann 是的,我明白了。但我的问题仍然存在。

标签: visual-studio-2015 azure-devops web-deployment precompile pre-compilation


【解决方案1】:

我的经理找到了答案!

解决方案 - 每当我们选择任务“Visual Studio Build”时,它与“MSBuild build”任务没有什么不同,除了我们要运行的 MSBuild 版本。因此,如果我将 /p:PublishProfile=/my/publishProfile/PUBXML 作为参数,它将不起作用。而不是所有参数都应该直接在构建任务的“MSbuild arguments”部分中。

现在我的 Visual Studio 任务配置看起来像

这很好用!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-13
    • 2018-03-01
    • 1970-01-01
    • 2011-04-21
    • 1970-01-01
    • 2023-01-20
    • 1970-01-01
    相关资源
    最近更新 更多