TFS 2018 Build (MSBuild) Multiple Project Error - tfs

I am in the process of converting an old TFS XAML build definition to the new build mechanism in TFS2018. In the old definition i was able to build multiple projects by filling in the Projects to build items in default build template and separate the projects with a "," comma.
$/WMS/Dev/sekoWMS/DPURevisionUpdater/DPURevisionUpdater.csproj,$/WMS/Dev/sekoWMS/DesktopApp/SEKOWMS/SEKOWMS.csproj
I have a new build in TFS 2018 and when I specify the same arguments in the solution line of the "build solution task", I get the following compiler error:
"C:\agent_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
"C:\agent_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe" "C:\agent_work\3\s\Dev\Dev\sekoWMS\DPURevisionUpdater\DPURevisionUpdater.csproj,$\WMS\Dev\sekoWMS\DesktopApp\SEKOWMS\SEKOWMS.csproj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"C:\agent_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=58de9b3f-5678-49d1-8fd4-e40a7fda7f3f|SolutionDir=C:\agent_work\3\s\Dev\Dev\sekoWMS\DPURevisionUpdater\DPURevisionUpdater.csproj,$\WMS\Dev\sekoWMS\DesktopApp\SEKOWMS"*ForwardingLogger,"C:\agent_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:UpdateRevision /target:publish /property:PublishDir="\harmonywebdev.admin.sekoww.com\SEKOApps\sites\Downloads\SEKOWMSUtilityDev\" /property:InstallURL="http://harmonywebdev.admin.sekoww.com:9300/SEKOWMSUtility...
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\agent_work\3\s\Dev\Dev\sekoWMS\DPURevisionUpdater\DPURevisionUpdater.csproj,$\WMS\Dev\sekoWMS\DesktopApp\SEKOWMS\SEKOWMS.csproj
Process 'msbuild.exe' exited with code '1'.
Is there a way to specify multiple projects (from different) directories so that they compile correctly?

New build system doesn't support comma to separate the projects, it only supports Wildcard. Including #Daniel's suggestions, you could also try the steps below:
First, map all projects that you want to build:
Then, specify **\*.csprojin the build task:

Here are some options:
Use a solution file
Use multiple build steps
Create your own custom msbuild .proj file

Related

MSBUILD: error MSB1009: Project file does not exist on Azure Devops TFS

I am receiving the above error when trying to run my build. I have looked at the other answers to this question and have ensured that the project does build in VS2019, that my solution paths are correct and that I have checked the clean box in my Visual Studio Build Task. I'm at a loss and was hoping that someone will see something I am missing. Here is the error log I receive:
2019-12-05T16:51:51.4631828Z ##[section]Starting: Build solution
CONSurvey
2019-12-05T16:51:51.4635684Z
============================================================================== 2019-12-05T16:51:51.4635853Z Task : Visual Studio build
2019-12-05T16:51:51.4636005Z Description : Build with MSBuild and set
the Visual Studio version property
2019-12-05T16:51:51.4636138Z Version : 1.151.2
2019-12-05T16:51:51.4636254Z Author : Microsoft Corporation
2019-12-05T16:51:51.4636405Z Help : More
Information
2019-12-05T16:51:51.4636579Z
2019-12-05T16:51:53.3057099Z
[command]"E:\tfs-agents\DHSS_VSTS_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.2\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -latest -format json
2019-12-05T16:51:53.6381113Z ##[command]"C:\Program Files
(x86)\Microsoft Visual
Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe"
"E:\tfs-agents\DHSS_VSTS_work\233\s\CONSurvey.sln" /nologo /nr:false
/t:"Clean" /fl
/flp:"logfile=E:\tfs-agents\DHSS_VSTS_work\233\s\CONSurvey.sln.log;verbosity=diagnostic"
/dl:CentralLogger,"E:\tfs-agents\DHSS_VSTS_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.2\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=99b4b9b2-7001-494c-962a-5d5532ebc121|SolutionDir=E:\tfs-agents\DHSS_VSTS_work\233\s"*ForwardingLogger,"E:\tfs-agents\DHSS_VSTS_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.2\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false
/p:DeployOnBuild=true;OutDir="E:\tfs-agents\DHSS_VSTS_work\233\a"
/p:platform="any cpu" /p:configuration="release"
/p:VisualStudioVersion="16.0"
/p:_MSDeployUserAgent="VSTS_15c81635-e2c4-41a0-95f6-2d0b2f6cbc4d_build_129_0"
2019-12-05T16:51:53.7934752Z MSBUILD : error MSB1009: Project file
does not exist.
2019-12-05T16:51:53.7973651Z Switch:
E:\tfs-agents\DHSS_VSTS_work\233\s\CONSurvey.sln
2019-12-05T16:51:53.9286545Z ##[error]Process 'msbuild.exe' exited
with code '1'.
2019-12-05T16:51:53.9661712Z ##[command]"C:\Program Files
(x86)\Microsoft Visual
Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe"
"E:\tfs-agents\DHSS_VSTS_work\233\s\CONSurvey.sln" /nologo /nr:false
/fl
/flp:"logfile=E:\tfs-agents\DHSS_VSTS_work\233\s\CONSurvey.sln.log;verbosity=diagnostic"
/dl:CentralLogger,"E:\tfs-agents\DHSS_VSTS_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.2\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=1029b97a-fe32-4d73-b976-928576336049|SolutionDir=E:\tfs-agents\DHSS_VSTS_work\233\s"*ForwardingLogger,"E:\tfs-agents\DHSS_VSTS_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.2\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false
/p:DeployOnBuild=true;OutDir="E:\tfs-agents\DHSS_VSTS_work\233\a"
/p:platform="any cpu" /p:configuration="release"
/p:VisualStudioVersion="16.0"
/p:_MSDeployUserAgent="VSTS_15c81635-e2c4-41a0-95f6-2d0b2f6cbc4d_build_129_0"
2019-12-05T16:51:54.1134908Z MSBUILD : error MSB1009: Project file
does not exist.
2019-12-05T16:51:54.1135166Z Switch:
E:\tfs-agents\DHSS_VSTS_work\233\s\CONSurvey.sln
2019-12-05T16:51:54.1648429Z ##[error]Process 'msbuild.exe' exited
with code '1'.
2019-12-05T16:51:54.2165236Z ##[section]Finishing: Build solution
CONSurvey
Edit: Yes, the solution file is there. It is not missing.
MSBUILD: error MSB1009: Project file does not exist on Azure Devops TFS
The cause of this issue usually comes from two aspects, one is the issue with the build definition settings, and the other is the issue of your project/solution itself.
For the build definition settings, you need to check if you omitted the actual solution file in the Solution text box instead of a solution path. For example,
The following shows just the folder path and this setting produces the error:
This is the correct setting with the solution file to build:
This setting has been a source of confusion due to the heading on the dialog to select the Path and not say select the Path to the Solution file.
For the ssue of your project/solution itself, since we do not have your solution/projects, we could not point directly to the issue. But you could build solution in the local machine without Azure devops, then check if you still have this issue.
Note: If you can build it success in you local machine, make sure you have check all required files to the source control.
Hope this helps.

error MSB1021: Cannot create an instance of the logger. Could not load file or assembly

I am very much new in TFS framework, and now i am creating build from last 3 days, all steps passes but fail # Build Solution with error:
[error]Process 'msbuild.exe' exited with code '1'.fails.png
My versions are:
TFS version: Version 15.105.25910.0
VS version: Microsoft Visual Studio Enterprice 2017 (15.9.4)
Can anyone from community tell me whats going wrong with my build.
Build Error:
2018-12-29T11:48:37.1011337Z ##[section]Starting: Build solution
*.sln 2018-12-29T11:48:43.4372323Z ##[command]"C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"
"\localhost\ARM-Drop1\1\s\LetsGo1\LetsGo1.sln" /nologo /nr:false
/dl:CentralLogger,"\localhost\ARM-Drop1_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.0.45\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=f568d794-328b-48cf-a753-e603bc019eed|SolutionDir=\localhost\ARM-Drop1\1\s\LetsGo1"ForwardingLogger,"\localhost\ARM-Drop1_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.0.45\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
/p:VisualStudioVersion="14.0"
/p:_MSDeployUserAgent="TFS_29388952-19c1-40f9-b321-9389f9ab526b_build_17_287"
2018-12-29T11:48:43.5382020Z MSBUILD : error MSB1021: Cannot create an
instance of the logger. Could not load file or assembly
'file://\localhost\ARM-Drop1_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.0.45\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll'
or one of its dependencies. The system cannot find the file specified.
2018-12-29T11:48:43.5392017Z Switch:
CentralLogger,\localhost\ARM-Drop1_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.0.45\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll;RootDetailId=f568d794-328b-48cf-a753-e603bc019eed|SolutionDir=\localhost\ARM-Drop1\1\s\LetsGo1
2018-12-29T11:48:43.7011531Z **##[error]Process 'msbuild.exe' exited
with code '1'. 2018-12-29T11:48:43.7871273Z ##[section]Finishing:
Build solution **.sln
I have resolved this bug, as I had done lot of changes into the solution file and the build definition in order to resolve the issues but no luck, so the quickest way I have in my mind is to delete the build definition plus uninstall the agent and again reconfigure it with appropriate agent capability and create new build definition and its all work as expected and the build definition got succeeded.

TFS 2015.1 - vNext - Using NuGet Packager but can't create package, invalid arguments

I'm using TFS 2015.1 (on premises not VSO), trying to build up to CI. The problem is that when using TFS "Nuget Packager" it is failing to create the nuget package from a csproj file. The same project can create on locally on my machine by using the same parameters.
Can anyone suggest why? Thanks.
Here is the packager log:
2016-04-13T17:37:34.3861624Z Set workingFolder to default: C:\TFS Build Agent\agent\tasks\NuGetPackager\0.1.56
2016-04-13T17:37:34.3881631Z Executing the powershell script: C:\TFS Build Agent\agent\tasks\NuGetPackager\0.1.56\NuGetPackager.ps1
2016-04-13T17:37:34.5071696Z Checking pattern is specified
2016-04-13T17:37:34.5081742Z No Pattern found in solution parameter.
2016-04-13T17:37:34.5121695Z Found files: 1
2016-04-13T17:37:34.5141691Z --File: C:\TFS Build Agent\agent\_work\2\s\WebFeatureService.csproj
2016-04-13T17:37:34.5151718Z Creating Nuget Arguments:
2016-04-13T17:37:34.5231689Z --ARGS: pack C:\TFS Build Agent\agent\_work\2\s\WebFeatureService.csproj -OutputDirectory C:\TFS Build Agent\agent\_work\2\s -Properties Configuration=Debug
2016-04-13T17:37:34.5241691Z Invoking nuget with pack C:\TFS Build Agent\agent\_work\2\s\WebFeatureService.csproj -OutputDirectory C:\TFS Build Agent\agent\_work\2\s -Properties Configuration=Debug on C:\TFS Build Agent\agent\_work\2\s
2016-04-13T17:37:34.5241691Z C:\TFS Build Agent\agent\agent\worker\tools\NuGet.exe pack C:\TFS Build Agent\agent\_work\2\s\WebFeatureService.csproj -OutputDirectory C:\TFS Build Agent\agent\_work\2\s -Properties Configuration=Debug
2016-04-13T17:37:34.9111884Z pack: invalid arguments.
2016-04-13T17:37:34.9321907Z usage: nuget pack <nuspec | project> [options]
2016-04-13T17:37:34.9321907Z Creates a NuGet package based on the specified nuspec or project file.
2016-04-13T17:37:34.9331905Z Specify the location of the nuspec or project file to create a package.
2016-04-13T17:37:34.9331905Z options:
2016-04-13T17:37:34.9341894Z -OutputDirectory Specifies the directory for the created NuGet package file. If not specified, uses the current directory.
2016-04-13T17:37:34.9341894Z -BasePath The base path of the files defined in the nuspec file.
2016-04-13T17:37:34.9341894Z -Verbose Shows verbose output for package building.
2016-04-13T17:37:34.9351910Z -Version Overrides the version number from the nuspec file.
2016-04-13T17:37:34.9351910Z -Exclude + Specifies one or more wildcard patterns to exclude when creating a package.
2016-04-13T17:37:34.9361907Z -Symbols Determines if a package containing sources and symbols should be created. When specified with a nuspec, creates a regular NuGet package file and the corresponding symbols package.
2016-04-13T17:37:34.9361907Z -Tool Determines if the output files of the project should be in the tool folder.
2016-04-13T17:37:34.9371921Z -Build Determines if the project should be built before building the package.
2016-04-13T17:37:34.9371921Z -NoDefaultExcludes Prevent default exclusion of NuGet package files and files and folders starting with a dot e.g. .svn.
2016-04-13T17:37:34.9371921Z -NoPackageAnalysis Specify if the command should not run package analysis after building the package.
2016-04-13T17:37:34.9381908Z -ExcludeEmptyDirectories Prevent inclusion of empty directories when building the package.
2016-04-13T17:37:34.9381908Z -IncludeReferencedProjects Include referenced projects either as dependencies or as part of the package.
2016-04-13T17:37:34.9391903Z -Properties + Provides the ability to specify a semicolon ";" delimited list of properties when creating a package.
2016-04-13T17:37:34.9391903Z -MinClientVersion Set the minClientVersion attribute for the created package.
2016-04-13T17:37:34.9401904Z -MSBuildVersion Specifies the version of MSBuild to be used with this command. Supported values are 4, 12, 14. By default the MSBuild in your path is picked, otherwise it defaults to the highest installed version of MSBuild.
2016-04-13T17:37:34.9401904Z -Help (?) help
2016-04-13T17:37:34.9401904Z -Verbosity Display this amount of details in the output: normal, quiet, detailed.
2016-04-13T17:37:34.9411909Z -NonInteractive Do not prompt for user input or confirmations.
2016-04-13T17:37:34.9411909Z For more information, visit http://docs.nuget.org/docs/reference/command-line-reference
It looks like a problem with the location where the build is running on the build server:
C:\TFS Build Agent\agent\agent\worker\tools\NuGet.exe pack C:\TFS
Build Agent\agent_work\2\s\WebFeatureService.csproj -OutputDirectory
C:\TFS Build Agent\agent_work\2\s -Properties Configuration=Debug
This is probably struggling on the server due to the lack of quotes around the path to the CSPROJ file.
On my VSTS hosted build agent everything is executing in C:\a\1\s\....
Try changing the local installation of the Agent.
If that turns out to be it, let me know, I think I know what needs to be done to fix it.

TFS build does not apply the value of $(VSInstallDir) macros

I have a build-machine and I have made simple changes recently to run editbin.exe tool with LARGEADDRESSAWARE parameter right after each building. The tool is located in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin (of course, the path can be another). And I have added new target to the build.proj file:
<Exec command=""$(VSInstallDir)\VC\bin\editbin.exe" /LARGEADDRESSAWARE "Manager.exe""/>
If I run MS Build locally on the build machine it works properly. Good! But after any checkin build is not able to be completed with the following error:
The command ""\VC\bin\editbin.exe"" exited with code 3. As I understand TFS build does not apply the value of $(VSInstallDir) macros (C:\Program Files (x86)\Microsoft Visual Studio 12.0\ in my case). Any suggesting?
To resolve the problem I did the next: In VS build config: Process->Build process parameters->5. Advances->MSBuild arguments added /p:VSInstallDir = Value

Build Installshield project using TFS build

I am working on Installshield and TFS (VSTS 2008) and now I want to build Installshield 2011 Project along with build definition.
For this I have created build.proj file which contains build definitions to build .sln projects which is working fine.
Now at end of Build definition file I have added like this :
<Target Name="AfterCompile">
I have added the reference of Installshield project, so that after building Visual Studio projects start building Installshield projects at the end:
<Exec Command=""$(DevEnvDir)\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build"/>
Earlier I have used VSINSTALLDIR in palce of DevEnvDir still error will come which says
Task "Exec"
Command:
"\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build
The system cannot find the path specified.
E:\BuildSource\Temp\BuildType\TFSBuild.proj(444,5): error MSB3073: The command ""\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build" exited with code 3.
Done executing task "Exec" -- FAILED.
Done building target "AfterCompile" in project "TFSBuild.proj" -- FAILED.
Done Building Project "E:\BuildSource\Temp\BuildType\TFSBuild.proj" (EndToEndIteration target(s)) -- FAILED.
Build FAILED.
"E:\BuildSource\Temp\BuildType\TFSBuild.proj" (EndToEndIteration target) (1) ->
(AfterCompile target) ->
E:\BuildSource\Temp\BuildType\TFSBuild.proj(444,5): error MSB3073: The command ""\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build" exited with code 3.
0 Warning(s)
1 Error(s)
I am new to this VSTS and TFS build configurations.
We use something like this:
Command=""%programfiles%\Microsoft Visual Studio 8\Common7\IDE\devenv" ..."
Would that work for you?
-- EDIT --
Another thought that came to mind is the suggestion that you consider WIX instead of InstallShield. WIX projects work really well within MSBuild.
I can't think of any valid reason that the path to your InstallShield project should be hard-coded as it appears in your question.
Can you build the *.isproj file from the command line with MSBuild? If so, then you could just add it to your solution and set it up to only build for a new solution configuration that you use in your TFS build.

Resources