0
votes

We have a TFS 2017 build that I've just ported (recreated) to a different project and one of my .sln files isn't being built. The bin\release folder is empty after the build step. Here's the command being executed by the build step:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\PGScannerService.sln" /nologo /nr:false /dl:CentralLogger,"C:\TFS2017_Builld_Agent2\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService"*ForwardingLogger,"C:\TFS2017_Builld_Agent2\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"  /p:platform="x86" /p:configuration="Release" /p:_MSDeployUserAgent="TFS_e143528a-7a2f-41eb-b587-1d8ceb3e1fa8_build_136_8275"

And if I open a command prompt and run this command as-is the release folder is populated as expected, but not via the TFS build. The build step says that it finished successfully. What's going on here?

Just for completeness here's the entire build log for this .sln:

2018-05-24T17:49:22.9911639Z ##[section]Starting: Build solution PGScannerService.sln
2018-05-24T17:49:23.0161664Z ==============================================================================
2018-05-24T17:49:23.0161664Z Task         : MSBuild
2018-05-24T17:49:23.0171665Z Description  : Build with MSBuild
2018-05-24T17:49:23.0171665Z Version      : 1.119.0
2018-05-24T17:49:23.0171665Z Author       : Microsoft Corporation
2018-05-24T17:49:23.0171665Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613724)
2018-05-24T17:49:23.0171665Z ==============================================================================
2018-05-24T17:49:33.5172164Z ##[command]"C:\TFS2017_Builld_Agent2\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2018-05-24T17:49:33.9122559Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\PGScannerService.sln" /nologo /nr:false /dl:CentralLogger,"C:\TFS2017_Builld_Agent2\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService"*ForwardingLogger,"C:\TFS2017_Builld_Agent2\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.119.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"  /p:platform="x86" /p:configuration="Release" /p:_MSDeployUserAgent="TFS_e143528a-7a2f-41eb-b587-1d8ceb3e1fa8_build_136_8275"
2018-05-24T17:49:34.7263373Z Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
2018-05-24T17:49:34.8713518Z Build started 5/24/2018 10:49:34 AM.
2018-05-24T17:49:35.1863833Z Project "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\PGScannerService.sln" on node 1 (default targets).
2018-05-24T17:49:35.1873834Z ValidateSolutionConfiguration:
2018-05-24T17:49:35.1883835Z   Building solution configuration "Release|x86".
2018-05-24T17:49:35.4464093Z Project "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\PGScannerService.sln" (1) is building "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj" (2) on node 1 (default targets).
2018-05-24T17:49:35.4464093Z RestorePackages:
2018-05-24T17:49:35.4464093Z   "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\.nuget\NuGet.exe" install "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\packages.config" -source ""  -NonInteractive -RequireConsent -solutionDir "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ "
2018-05-24T17:49:38.0566703Z   Restoring NuGet packages...
2018-05-24T17:49:38.0566703Z   To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the NuGet Package Manager node and uncheck 'Allow NuGet to download missing packages'.
2018-05-24T17:49:38.1916838Z   Feeds used:
2018-05-24T17:49:38.1916838Z     https://api.nuget.org/v3/index.json
2018-05-24T17:49:38.1916838Z     C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
2018-05-24T17:49:38.1926839Z   
2018-05-24T17:49:38.2006847Z   All packages listed in C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\packages.config are already installed.
2018-05-24T17:49:38.3426989Z PrepareForBuild:
2018-05-24T17:49:38.3426989Z   Creating directory "bin\x86\Release\".
2018-05-24T17:49:38.3476994Z   Creating directory "obj\x86\Release\".
2018-05-24T17:49:38.8487495Z CoreResGen:
2018-05-24T17:49:38.8497496Z   "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /r:C:\Packages\Pacsgear.Debug.PacsgearLib.2.5.4\lib\net40\PacsgearLib.dll /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Configuration.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Deployment.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceModel.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceModel.Web.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /r:C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\TwainNet.dll /compile MainForm.resx,obj\x86\Release\PG.Scanner.Service.ScannerService.resources Properties\Resources.resx,obj\x86\Release\PG.Scanner.Service.Properties.Resources.resources
2018-05-24T17:49:38.8507497Z   Processing resource file "MainForm.resx" into "obj\x86\Release\PG.Scanner.Service.ScannerService.resources".
2018-05-24T17:49:38.8597506Z   Processing resource file "Properties\Resources.resx" into "obj\x86\Release\PG.Scanner.Service.Properties.Resources.resources".
2018-05-24T17:49:38.9377584Z CoreCompile:
2018-05-24T17:49:38.9387585Z   C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /unsafe+ /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:C:\Packages\Pacsgear.Debug.PacsgearLib.2.5.4\lib\net40\PacsgearLib.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Configuration.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Deployment.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceModel.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceModel.Web.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /reference:C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\TwainNet.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\x86\Release\PGScannerService.exe /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /resource:obj\x86\Release\PG.Scanner.Service.ScannerService.resources /resource:obj\x86\Release\PG.Scanner.Service.Properties.Resources.resources /target:winexe /utf8output MainForm.cs MainForm.Designer.cs Program.cs Properties\AssemblyInfo.cs ScannerApi.cs ScannerApiContract.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs "C:\TFS2017_Builld_Agent2\_work\_temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
2018-05-24T17:49:38.9797626Z   Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn
2018-05-24T17:49:39.2717918Z ##[warning]CorePlatform\ScannerService\ScannerService\MainForm.cs(205,30): Warning CS0168: The variable 'ex' is declared but never used
2018-05-24T17:49:39.2717918Z MainForm.cs(205,30): warning CS0168: The variable 'ex' is declared but never used [C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj]
2018-05-24T17:49:39.2717918Z ##[warning]CorePlatform\ScannerService\ScannerService\MainForm.cs(40,29): Warning CS0169: The field 'ScannerService.t' is never used
2018-05-24T17:49:39.2717918Z MainForm.cs(40,29): warning CS0169: The field 'ScannerService.t' is never used [C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj]
2018-05-24T17:49:39.2727919Z ##[warning]CorePlatform\ScannerService\ScannerService\MainForm.cs(25,23): Warning CS0414: The field 'ScannerService.MaxPaperHeightInInches' is assigned but its value is never used
2018-05-24T17:49:39.2727919Z MainForm.cs(25,23): warning CS0414: The field 'ScannerService.MaxPaperHeightInInches' is assigned but its value is never used [C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj]
2018-05-24T17:49:39.2727919Z _CopyFilesMarkedCopyLocal:
2018-05-24T17:49:39.2727919Z   Copying file from "C:\Packages\Pacsgear.Debug.PacsgearLib.2.5.4\lib\net40\PacsgearLib.dll" to "bin\x86\Release\PacsgearLib.dll".
2018-05-24T17:49:39.3017948Z   Copying file from "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\TwainNet.dll" to "bin\x86\Release\TwainNet.dll".
2018-05-24T17:49:39.3317978Z   Copying file from "C:\Packages\Pacsgear.Debug.PacsgearLib.2.5.4\lib\net40\PacsgearLib.pdb" to "bin\x86\Release\PacsgearLib.pdb".
2018-05-24T17:49:39.3367983Z   Creating "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\obj\x86\Release\ScannerApp.csproj.CopyComplete" because "AlwaysCreate" was specified.
2018-05-24T17:49:39.3417988Z _CopyAppConfigFile:
2018-05-24T17:49:39.3417988Z   Copying file from "App.config" to "bin\x86\Release\PGScannerService.exe.config".
2018-05-24T17:49:39.3447991Z CopyFilesToOutputDirectory:
2018-05-24T17:49:39.3447991Z   Copying file from "obj\x86\Release\PGScannerService.exe" to "bin\x86\Release\PGScannerService.exe".
2018-05-24T17:49:39.4078054Z   ScannerApp -> C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\bin\x86\Release\PGScannerService.exe
2018-05-24T17:49:39.4088055Z   Copying file from "obj\x86\Release\PGScannerService.pdb" to "bin\x86\Release\PGScannerService.pdb".
2018-05-24T17:49:39.4318078Z Done Building Project "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj" (default targets).
2018-05-24T17:49:39.4328079Z Done Building Project "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\PGScannerService.sln" (default targets).
2018-05-24T17:49:39.4358082Z 
2018-05-24T17:49:39.4358082Z Build succeeded.
2018-05-24T17:49:39.4398086Z 
2018-05-24T17:49:39.4398086Z "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\PGScannerService.sln" (default target) (1) ->
2018-05-24T17:49:39.4408087Z "C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj" (default target) (2) ->
2018-05-24T17:49:39.4408087Z (CoreCompile target) -> 
2018-05-24T17:49:39.4408087Z   MainForm.cs(205,30): warning CS0168: The variable 'ex' is declared but never used [C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj]
2018-05-24T17:49:39.4408087Z   MainForm.cs(40,29): warning CS0169: The field 'ScannerService.t' is never used [C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj]
2018-05-24T17:49:39.4408087Z   MainForm.cs(25,23): warning CS0414: The field 'ScannerService.MaxPaperHeightInInches' is assigned but its value is never used [C:\TFS2017_Builld_Agent2\_work\1\s\CorePlatform\ScannerService\ScannerService\ScannerApp.csproj]
2018-05-24T17:49:39.4408087Z 
2018-05-24T17:49:39.4408087Z     3 Warning(s)
2018-05-24T17:49:39.4408087Z     0 Error(s)
2018-05-24T17:49:39.4408087Z 
2018-05-24T17:49:39.4408087Z Time Elapsed 00:00:04.57
2018-05-24T17:49:39.4958142Z ##[section]Finishing: Build solution PGScannerService.sln
1
What MSBuild arguments are you providing? What happens if you provide the /p:OutDir parameter and specify a different folder (such as $(Build.ArtifactStagingDirectory))? Did you try publishing the build artifact from $(Build.SourcesDirectory)/CorePlatform\ScannerService\ScannerService\bin\x86\Release`?Daniel Mann

1 Answers

0
votes

Thanks Daniel - I added the parameter:

/p:OutDir=$(Build.SourcesDirectory)/CorePlatform\ScannerService\ScannerService\bin\x86\Release

and it works now. No idea why I have to do this when all of my other projects build as expected.