问题
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
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:
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,
This works great!
来源:https://stackoverflow.com/questions/53931787/azure-devops-build-publish-doesnt-create-compiled-files-in-bin-folder-on-pub