2017-09-29 8 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 ** 작업 전에 ** NuGet ** 작업을 사용 하시겠습니까? 그리고'BuildConfiguration'을'debug'로,'BuildPlatform'을'any cpu'로 다시 빌드하면 어떻게 될까요? –

+0

빌드 정의에서 변수 설정을 공유 할 수 있습니까? –

+0

@ Marina-MSFT : 긍정적 결과없이 NuGet을 복원하고 변수를 설정했습니다. – AJRames

답변

1
  • , 당신은 변수 탭에 변수를 추가 할 수 있습니다

    BuildPlatform = any cpu

    BuildConfiguration = debug

  • 를 두 번째 문제의 참고에있는 다른 프로젝트를 다른 자식 repo, 당신은 자신의 repo 아래에 참조 된 프로젝트를 넣어해야합니다.

    옵션 1 : 두 가지 옵션이 있습니다 당신은 당신의 자식의 repo에서 참조 된 프로젝트를 복사 할 수 있습니다 당신의 자식의 repo

    에 직접 프로젝트를 복사하고, 자신의 자식의 repo에서 새 경로로 함. 그런 다음 변경 사항을 커밋하고 원격으로 푸시하면 프로젝트를 성공적으로 빌드 할 수 있습니다.

    옵션 2 : 당신의 자식의 repo에 대한 서브 모듈/서브 트리로합니다 (refernced 프로젝트가 위치한) 다른 REPO를 추가

    당신은 당신의 자신의 repo에 대한 서브 모듈로 REPO을 치료하기 위해 git submodule add <URL for the other repo>를 사용하거나 사용할 수 git subtree add --prefix=foldername <URL for the other repo> branchname 다른 repo의 branchname을 자신의 Repo에 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'또는 해당 종속성 중 하나를로드 할 수 없습니다. 지정된 파일을 찾을 수 없습니다. " – 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