Visual studio 2015 Azure DevOps构建-发布不';t发布时在bin文件夹中创建.compiled文件

Visual studio 2015 Azure DevOps构建-发布不';t发布时在bin文件夹中创建.compiled文件,visual-studio-2015,azure-devops,web-deployment,precompile,pre-compilation,Visual Studio 2015,Azure Devops,Web Deployment,Precompile,Pre Compilation,我有一个web项目,我正在从Azure DevOps构建管道构建并创建一个已发布的包 我运行时遇到了一个问题,即在发布时无法获取bin文件夹中的.compile文件。当我从direct build机器的VS 2015(azure DevOps构建也在其上运行)发布时,我得到了所有的.compile文件 My.pubxml文件 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2

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

我运行时遇到了一个问题,即在发布时无法获取bin文件夹中的.compile文件。当我从direct build机器的VS 2015(azure DevOps构建也在其上运行)发布时,我得到了所有的.compile文件

My.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>

文件系统
释放
任何CPU
真的
真的
假的
真的
创建分离组件
真的
假的
E:\DevOps\agent\vsts-agent-win-x64-2.136.1\QAWeb\u工件
真的
Azure DevOps管道中的任务配置

<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构建和发布网站时缺少的内容。

我的经理找到了答案

解决方案- 每当我们选择任务“Visual Studio Build”时,它与“MSBuild Build”任务没有区别,但要运行的MSBuild版本除外。因此,如果我将
/p:PublishProfile=/my/PublishProfile/PUBXML
作为参数,它将不起作用。而不是所有参数都应直接位于生成任务的“MSbuild arguments”部分

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


这太棒了

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