2
votes

I have a simple Solution tree:

Repository: DFW-SPF-Website |-- Solution: DFWSPFWebsite |-- |-- Project: DFWSPFWebsite

In my previous post I explained the contortions I had to go through to get VSTS to find my NuGet Packages. It took a while to lead its MSBuild process to even find the .sln file. Now MSBuild can't find the Project file. Really?!

After countless incarnations, my current build settings are:

Solution: $(build.sourcesDirectory)/DFWSPFWebsite/DFWSPFWebsite.sln

MSBuild Arguments: /p:ProjectFile=$(build.sourcesDirectory)\DFWSPFWebsite\DFWSPFWebsite\DFWSPFWebsite.csproj

Platform: $(BuildPlatform) Configuration: $(BuildConfiguration) Clean: true VS Version: 2015/2017/Latest (tried them all) Control Options: Enabled

I can't get past the MSBuild error of:

"C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" "D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.sln" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"D:\a_tasks\VSBuild_abc-xyz\1.113.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=abc-xyz|SolutionDir=D:\a\1\s\DFWSPFWebsite"*ForwardingLogger,"D:\a_tasks\VSBuild_71abc-xyz\1.113.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:ProjectFile=D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.csproj /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0" /p:_MSDeployUserAgent="VSTS_abc-xyz_build_2_38" MSBUILD : error MSB1009: Project file does not exist. Switch: D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.sln Process 'msbuild.exe' exited with code '1'. "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" "D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.sln" /nologo /nr:false /dl:CentralLogger,"D:\a_tasks\VSBuild_71abc-xyz\1.113.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=abc-xyz|SolutionDir=D:\a\1\s\DFWSPFWebsite"*ForwardingLogger,"D:\a_tasks\VSBuild_71abc-xyz\1.113.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:ProjectFile=D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.csproj /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0" /p:_MSDeployUserAgent="VSTS_14abc-xyz_build_2_38" MSBUILD : error MSB1009: Project file does not exist. Switch: D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.sln Process 'msbuild.exe' exited with code '1'.

I never thought I'd miss my XAML deployment so much.

2
Please check in your project, if it’s exist project file in DFWSPFWebsite\DFWSPFWebsite\DFWSPFWebsite.csproj. BTW, please also check MSBuild Arguments, it’s /p:ProjectFile=$(build.sourcesDirectory)\DFWSPFWebsite\DFWSPFWebsite\DFWSPFWebsite.csproj or /p:ProjectFile=$(build.sourcesDirectory)\DFWSPFWebsite \DFWSPFWebsite.csproj. Based on your log /p:ProjectFile=D:\a\1\s\DFWSPFWebsite\DFWSPFWebsite.csproj, it seems the argument you set is /p:ProjectFile=$(build.sourcesDirectory)\DFWSPFWebsite. - Marina Liu
If I look in the Code tab, the Project is there as are all required files. In desperation, I've tried both versions of the Project path @Marina mentions as well as countless other variances. I'm almost to the point of rebuilding the entire thing in VS 2015 under the suspicion that my base problem is that, even though I've migrated it through ever version of VS since then, I started the sln a long time ago in VS 2010. The thing is, finding a .csproj file is such a simple thing - how can this not work? And I still have more steps to deployment. Troubling. - KramFfud
What if you leave the MSBuild Arguments empty? It defaultly find the project file in current working directly. - Marina Liu
If I leave the MSBuild Arguments empty, I get the same error as above. The Build finds the NuGet Packages folder and .sln file only because because I specify nearly absolute paths to them. ***.sln path variations haven't worked for any of my Build settings. Now MSBuild finds them, but can't find the Project which is right under the Solution's nose - even if I lead MSBuild to the project by the hand (Arguments). How is this possible? - KramFfud

2 Answers

0
votes

I GOT A CLEAN BUILD!!! Yes, ellipses are good – I was using the pre-release UI. I also had to relocate a couple of external referenced dlls into a dll folder under the sln. And, I had to remove the <Target Name="EnsureBclBuildImported"…/>, <Import Project="..\packages\Microsoft.Bcl.Build…/> and <Target Name="EnsureNuGetPackageBuildImports"…/> nodes from the csproj file. See [MSDN] (https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#migrating-to-automatic-restore) Because I’m not supposed to on SO, I will not send my incalculable appreciation to @Marina. :*

-1
votes

First, please build your solution in VS 2015 to make sure it can build successfully. Then you can build in VSTS.

Since you only want to build one solution, so you can select DFWSPFWebsite.sln from button both for nuget installer task and visual studio build task.

Nugget installer:

enter image description here

Visual studio build:

enter image description here