Azure DevOps Build - 发布时不会在 bin 文件夹中创建 .compiled 文件

Azure DevOps Build - publish doesn't create .compiled files in bin folder on publish

我有一个 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 构建和发布我的网站时,请提出我遗漏的建议。

我的经理找到了答案!!

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

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

效果很好!