Reputation: 145
I try to make a simple build and publish on tfs online for my provider hosted sharepoint application. After some NuGet tasks I'm using "Visual Studio Build" Task and after that I try to publish it with "dotnet publish" task. Problem: I dont get any published files to make the drop. The Build seems to be successfull but there are no publishing files. Here some items from the log:
******************************************************************************
Starting: Build solution **\*.sln
******************************************************************************
==============================================================================
Task : Visual Studio Build
Description : Build with MSBuild and set the Visual Studio version property
Version : 1.120.0
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613727)
==============================================================================
"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
The 'Restore NuGet Packages' option is deprecated. To restore NuGet packages in your build, add a NuGet Installer task to your build definition.
"C:\LR\mms\Services\Mms\Provisioner\TaskAgent\agents\2.123.0\externals\nuget\NuGet.exe" restore "d:\a\1\s\MySampleApp.sln" -NonInteractive
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "d:\a\1\s\MySampleApp.sln" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=09f9adae-970e-4be0-bcfa-d953d972e1ed|SolutionDir=d:\a\1\s"*ForwardingLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="d:\a\1\a//" /p:platform="$(BuildPlatform)" /p:configuration="$(BuildConfiguration)" /p:VisualStudioVersion="15.0" /p:_MSDeployUserAgent="VSTS_bf1ff99a-938b-4307-8b5d-344c8a51e178_build_197_36516"
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 9/29/2017 3:51:58 PM.
d:\a\1\s\MySampleApp.sln.metaproj(0,0): Warning MSB4126: The specified solution configuration "$(BuildConfiguration)|$(BuildPlatform)" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
Project "d:\a\1\s\MySampleApp.sln" on node 1 (default targets).
d:\a\1\s\MySampleApp.sln.metaproj : warning MSB4126: The specified solution configuration "$(BuildConfiguration)|$(BuildPlatform)" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [d:\a\1\s\MySampleApp.sln]
Done Building Project "d:\a\1\s\MySampleApp.sln" (default targets).
Build succeeded.
"d:\a\1\s\MySampleApp.sln" (default target) (1) ->
(ValidateSolutionConfiguration target) ->
d:\a\1\s\MySampleApp.sln.metaproj : warning MSB4126: The specified solution configuration "$(BuildConfiguration)|$(BuildPlatform)" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [d:\a\1\s\MySampleApp.sln]
1 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.14
******************************************************************************
Finishing: Build solution **\*.sln
******************************************************************************
******************************************************************************
Starting: dotnet restore
******************************************************************************
==============================================================================
Task : .NET Core
Description : Build, test and publish using dotnet core command-line.
Version : 1.0.2
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
==============================================================================
Project file(s) matching the specified pattern were not found.
******************************************************************************
Finishing: dotnet restore
******************************************************************************
******************************************************************************
Starting: dotnet publish
******************************************************************************
==============================================================================
Task : .NET Core
Description : Build, test and publish using dotnet core command-line.
Version : 1.0.2
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
==============================================================================
"C:\Program Files\dotnet\dotnet.exe" publish d:\a\1\s\MySampleApp\MySampleAppWeb\MySampleAppWeb.csproj -c $(build.configuration) -o d:\a\1\a\pub\MySampleAppWeb
C:\Program Files\dotnet\sdk\2.0.0\NuGet.targets(782,5): warning MSB3202: The project file "d:\a\1\MasterPageApp\XXXXXCommon\XXXXXCommon.csproj" was not found. [d:\a\1\s\MySampleApp\MySampleAppWeb\MySampleAppWeb.csproj]
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
******************************************************************************
Finishing: dotnet publish
******************************************************************************
******************************************************************************
Starting: Publish Artifact: drop
******************************************************************************
==============================================================================
Task : Publish Build Artifacts
Description : Publish Build artifacts to the server or a file share
Version : 1.120.1
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
==============================================================================
Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.
******************************************************************************
Finishing: Publish Artifact: drop
******************************************************************************
******************************************************************************
Starting: Post Job Cleanup
******************************************************************************
Cleaning any cached credential from repository: MySampleApp (Git)
git remote set-url origin https://XXXXX.visualstudio.com/MyProject%20Development/_git/MySampleApp
git remote set-url --push origin https://XXXXX.visualstudio.com/MyProject%20Development/_git/MySampleApp
******************************************************************************
Finishing: Post Job Cleanup
******************************************************************************
******************************************************************************
Finishing: Phase 1
******************************************************************************
Here some configs: MSBild Arguments:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)//"
dotnet publish Arguments:
-c $(build.configuration) -o $(Build.ArtifactStagingDirectory)/pub
Publish Build Artifact:
$(Build.ArtifactStagingDirectory)
I hope somebody can help me. Thanks!
Upvotes: 0
Views: 1009
Reputation: 38096
For the initial issue, you can add the variables in variables Tab:
BuildPlatform
=any cpu
BuildConfiguration
=debug
For the second issue reference another project which located in a different git repo, you should put the referenced project under your own repo. There are two options:
Option 1: copy the project directly to your git repo
You can copy the referenced project in your git repo, and referred with the new path in your own git repo. Then commit and push the changes to remote, and then your can build your project successfully.
Option2: add the other repo (which the refernced project located) as submodule/subtree for your git repo
You can use git submodule add <URL for the other repo>
to treat the repo as submodule for your own repo, or you can use git subtree add --prefix=foldername <URL for the other repo> branchname
to add the branchname
from the other repo as the foldername
in your own repo.
Then you can reference the project under the path from your own project, commit and push changes, then you can build successfully.
Upvotes: 1