No package generated in VSTS build (for ASP.net project), so that release failed, why?

谁都会走 提交于 2019-12-11 16:25:11

问题


I'm using Microsoft team foundation server 2018's build task to build the Asp.net project and then deploy it to Microsoft Azure Website.

The following MsBuild command should publish the website to a publishing package in the build agent's artifact directory:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" 
"C:\agent\_work\8\s\Altoro.sln" /nologo /nr:false /dl:CentralLogger,"C:\agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=9ac05cfe-e8e9-42b6-a469-24e84f79ebe9|SolutionDir=C:\agent\_work\8\s"*ForwardingLogger,"C:\agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" 
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true 
/p:SkipInvalidConfigurations=true /p:PackageLocation="C:\agent\_work\8\a\\" 
/p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="15.0" 
/p:_MSDeployUserAgent="TFS_2386aba1-5b25-4025-ba06-4677ece9a429_build_8_125"

The build succeeded, however, there is no package generated, so the next release job failed with

'2017-12-02T07:36:56.2618898Z ##[warning]Folder “C:\agent_work\8\a”is empty。no content will be added to drop folder。


回答1:


To build ASP.NET website project, you should build *.publishproj instead of *.sln in Visual Studio build task

In your build definition -> unlink **\*.sln for Visual Studio build task -> specify the path to *.publishproj file -> save and build again.



来源:https://stackoverflow.com/questions/47605806/no-package-generated-in-vsts-build-for-asp-net-project-so-that-release-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!