2017-08-14 8 views
0

TeamCityのMy Build and Deployステップが正常に実行されません。 それはTeamCityでNuGetパッケージをビルドして展開するステップ

を示している「このプロジェクトは、このコンピュータに不足しているNuGetパッケージ(複数可)を参照しています。使用NuGetパッケージは、それらをダウンロードするために復元します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105を参照してください。見つからないファイルがある.. \パッケージ\ Microsoft.Net.Compilers.1.0.0 \ build \ Microsoft.Net.Compilers.props。 "以下は

段階のプロセスのログです:

[Step 1/1] WebApplication2.sln.teamcity: Build target: TeamCity_Generated_Build 
[22:31:54][WebApplication2.sln.teamcity] TeamCity_Generated_Build 
[22:31:54][TeamCity_Generated_Build] MSBuild 
[22:31:54][MSBuild] WebApplication2.sln: Build default targets 
[22:31:54][WebApplication2.sln] ValidateSolutionConfiguration 
[22:31:54][ValidateSolutionConfiguration] Building solution configuration "Debug|Any CPU". 
[22:31:54][WebApplication2.sln] Build 
[22:31:54][Build] MSBuild 
[22:31:54][MSBuild] WebApplication2\WebApplication2.csproj: Build default targets 
[22:31:54][WebApplication2\WebApplication2.csproj] EnsureNuGetPackageBuildImports 
[22:31:54][EnsureNuGetPackageBuildImports] Error 
[22:31:54][Error] R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2\WebApplication2.csproj(282, 5): This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props. 
[22:31:54][Step 1/1] MSBuild command line parameters contain "/property:" or "/p:". It is recommended to define System Property on Build Parameters instead. 
[22:31:54][Step 1/1] Process exited with code 1 
[22:31:54][Step 1/1] MSBuild output 
[22:31:54][MSBuild output] Start MSBuild... 
[22:31:54][MSBuild output] 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe' '"@R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln.teamcity.msbuild.tcargs" R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln.teamcity' 
[22:31:54][MSBuild output] working dir = 'R:\teamcity\buildAgent\work\5cfc9181ba33f9ec' 
[22:31:54][MSBuild output] Microsoft (R) Build Engine version 4.7.2046.0 
[22:31:54][MSBuild output] [Microsoft .NET Framework, version 4.0.30319.42000] 
[22:31:54][MSBuild output] Copyright (C) Microsoft Corporation. All rights reserved. 
[22:31:54][MSBuild output] 
[22:31:54][MSBuild output] Build started 14/08/2017 10:31:54 PM. 
[22:31:54][MSBuild output] Project "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln.teamcity" on node 1 (TeamCity_Generated_Build target(s)). 
[22:31:54][MSBuild output] Project "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln.teamcity" (1) is building "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln" (2) on node 1 (default targets). 
[22:31:54][MSBuild output] ValidateSolutionConfiguration: 
[22:31:54][MSBuild output] Building solution configuration "Debug|Any CPU". 
[22:31:54][MSBuild output] Project "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln" (2) is building "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2\WebApplication2.csproj" (3) on node 1 (default targets). 
[22:31:54][MSBuild output] R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2\WebApplication2.csproj(282,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props. 
[22:31:54][MSBuild output] Done Building Project "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2\WebApplication2.csproj" (default targets) -- FAILED. 
[22:31:54][MSBuild output] Done Building Project "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln" (default targets) -- FAILED. 
[22:31:54][MSBuild output] Done Building Project "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln.teamcity" (TeamCity_Generated_Build target(s)) -- FAILED. 
[22:31:54][MSBuild output] 
[22:31:54][MSBuild output] Build FAILED. 
[22:31:54][MSBuild output] 
[22:31:54][MSBuild output] "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln.teamcity" (TeamCity_Generated_Build target) (1) -> 
[22:31:54][MSBuild output] "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2.sln" (default target) (2) -> 
[22:31:54][MSBuild output] "R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2\WebApplication2.csproj" (default target) (3) -> 
[22:31:54][MSBuild output] (EnsureNuGetPackageBuildImports target) -> 
[22:31:54][MSBuild output] R:\teamcity\buildAgent\work\5cfc9181ba33f9ec\WebApplication2\WebApplication2.csproj(282,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props. 
[22:31:54][MSBuild output] 
[22:31:54][MSBuild output]  0 Warning(s) 
[22:31:54][MSBuild output]  1 Error(s) 
[22:31:54][MSBuild output] 
[22:31:54][MSBuild output] Time Elapsed 00:00:00.19 
[22:31:55][Step 1/1] Process exited with code 1 
[22:31:54][Step 1/1] Step Build and Deploy (MSBuild) failed 

これは、私はステップでコマンドラインパラメータで使用するものです。

/p:Configuration=Debug 
/p:DeployOnBuild=true 
/p:WebPublishMethod=Package 
/p:PackageAsSingleFile=true 
/p:SkipInvalidConfigurations=true 
/p:VisualStudioVersion=14.0 
/p:PackageLocation="$(build.artifactstagingdirectory)\\" 

は、私が適切に何かを逃したかないなら、私を知ってみましょうコマンドラインパラメータでコード化されています。

ありがとうございます!

答えて

0

最初にNuGet.exeをTeamCity Toolsにインストールします。 enter image description here

次に、コードをコンパイルする前に別のビルドステップを追加して、プロジェクト内のnugetパッケージを復元しました。

enter image description here

1

プロジェクトまたはソリューションファイルを追加するのを忘れました。

msbuild .\WebApplication2.sln /p:Configuration=Debug 
/p:OutputPath=bin 
/p:DeployOnBuild=True 
/p:DeployTarget=MSDeployPublish 

または、プロジェクトファイル名にスペースを入れてください。引用符を追加する必要があります。

+0

まだ同じ結果が得られています。 –

関連する問題