2017-09-29 3 views
0

私は単純なビルドを行い、プロバイダのホストされているSharepointアプリケーションのtfsオンラインで公開しようとしています。 いくつかのNuGetタスクの後、私は "Visual Studio Build"タスクを使用しています。その後、 "dotnet publish"タスクで公開しようとしています。 問題:ドロップしたファイルが公開されていません。 ビルドは成功したようですが、公開ファイルはありません。ログから ここではいくつかの項目:ここでTFS Onlineビルドして公開する

****************************************************************************** 
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 
****************************************************************************** 

いくつかのconfigs: MSBild引数:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)//" 

DOTNET公開引数:

-c $(build.configuration) -o $(Build.ArtifactStagingDirectory)/pub 

公開ビルドアーティファクト:

$(Build.ArtifactStagingDirectory) 

誰かが私を助けてくれることを願っています。 ありがとう!

最初の問題については
+0

** Visual Studio Build **タスクの前に** restore'コマンドを使ってNuGet **タスクを使用してください。また、 'BuildConfiguration'を' debug'、 'BuildPlatform'を' any cpu'としてビルドするとどうなりますか? –

+0

ビルド定義で変数設定を共有できますか? –

+0

@ Marina-MSFT:NuGetの復元と変数の設定の両方を行いましたが、肯定的な結果は得られませんでした。 – AJRames

答えて

1
  • 、あなたは変数タブで変数を追加することができます。第二の問題については

    BuildPlatform = any cpu

    BuildConfiguration = debug

  • にある別のプロジェクトを参照します別のgitリポジトリ、参照プロジェクトを自分のrepoの下に置くべきです。

    オプション1:そこの2つのオプションがあるあなたのGitのレポで参照プロジェクトをコピーすることができ、あなたのgitのレポ

    に直接プロジェクトをコピーして、独自のGitのリポジトリに新しいパスと呼ば。変更をコミットしてリモートにプッシュすると、プロジェクトを正常に構築できます。

    オプション2:あなたがあなた自身のレポのためのサブモジュールとしてレポを治療するためのgit submodule add <URL for the other repo>を使用することができ、またはあなたが使用することができ、あなたのgitのレポのためのサブモジュール/サブツリーとして

    を(referncedプロジェクトがあります)他のレポを追加git subtree add --prefix=foldername <URL for the other repo> branchnamebranchnameを他のレポから、foldernameとしてご自身のレポに追加してください。

    次に、自分のプロジェクトのパスの下でプロジェクトを参照し、コミットして変更をプッシュすると、正常にビルドできます。

+0

私はそれを試みました、そして、それは良い解決策であるようです。しかし私は私のソリューションを構築することはできません。 tfsオンラインではなく、ローカルよりもmsbuild。このエラーメッセージが表示されていて、それほど試してみました.... C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v15.0 \ SharePointTools \ Microsoft VisualStudio.SharePoint.targets(395,5):エラー:ファイルまたはアセンブリ 'Microsoft.VisualStudio.Shell.15.0、Version = 15.0.0.0、Culture = neutral、PublicKeyToken = b03f5f7f11d50a3a'またはその依存関係の1つを読み込めませんでした。指定されたファイルが見つかりません。 " – AJRames

+0

' .csproj'ファイルのパッケージパスが正しいことを確認してください。このリンクの最初の提案として、https://stackoverflow.com/questions/46039846/vsts-building-asp-net-core-2-0-compile-error-could-not-locate-the-assembly/46048058#46048058 。 –

+0

ビルドメソッドを "Visual Studio Build"からMSBuildに変更し、Argument/p:VisualStudioVersion = 15を設定して動作させました。次の問題:サブモジュールプロジェクトが見つかりませんでした(私のソリューションにProject XXXCommonを追加しました)。'd:\ a \ 1 \ s \ MySampleApp \ MySampleApp \ MySampleApp.csproj.metaproj(0,0):エラーMSB3202:プロジェクトファイル" d:\ a \ 1 \ s \ .. \ MasterPageApp \ XXXCommon \ XXXCommon .csproj "が見つかりませんでした。" – AJRames

関連する問題