4
votes

I have a web project I am building and creating a published package from Azure-DevOps Build pipeline.

I am running with the issue that not getting .compile files in bin folder while publishing. when I am publishing from the direct build machine's VS 2015(on which azure-DevOps builds are also running) I am getting all .compile files.

My .pubxml file

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

Task configuration in Azure-DevOps pipeline

enter image description here

I found the same issue here - https://forums.asp.net/t/1984856.aspx but not answered.

Please Suggest what I am missing when I build and publish my website from azure-DevOps.

1
First off, do not hard-code agent paths. Use variables such as $(Build.SourcesDirectory). Hard-coded paths will fail when run on other agents or if you clone the build definition.Daniel Mann
@DanielMann Yes, I get it.But my problem is still there.Darshana Patel

1 Answers

2
votes

My Manager found an answer !!

Solution - Whenever we choose task 'Visual Studio Build' it is not different from 'MSBuild build' task except MSBuild version which we want to run. So if I give /p:PublishProfile=/my/publishProfile/PUBXML as an argument it won't work. Rather than all parameter should be in 'MSbuild arguments' Section directly of build task.

Now My Visual Studio task configuration look like, enter image description here

This works great!