0

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。

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
zhuang
  • 49
  • 5
  • Please take a little time when posting to make the post readable. StackOverflow supports MarkDown. Check the edit I made, it's a lot easier to the eyes than before. Welcome to the community! And please read the guidance for good questions: https://stackoverflow.com/help/how-to-ask – jessehouwing Dec 02 '17 at 08:42
  • What's the project type Web application or website project etc? And can you show the detail build logs here? Is it possible to share a example project which has the same build error in one drive? – Marina Liu Dec 04 '17 at 06:03
  • thanks Marina, It is a ASP.Net project. I will just add you to my VSTS account so that you can check it online. thanks. – zhuang Dec 04 '17 at 12:51

1 Answers1

0

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.

enter image description here

Marina Liu
  • 36,876
  • 5
  • 61
  • 74
  • I tried it on my environment, it doesn't work. and It confused me why the solution file doesn't work? you can test it on my environment.thanks. – zhuang Dec 06 '17 at 02:42
  • If you are using the `$(BuildPlatform)` and `$(BuildConfiguration)` in VS build task, you must make sure the two variables exist in your VSTS build definition. – Marina Liu Dec 06 '17 at 03:04
  • still some confused, anyway, it is solved after adding $(BuildPlatform) and $(BuildConfiguration) to the build definition. thanks. I will double check the environment later. – zhuang Dec 06 '17 at 09:37