2017-06-30 10 views
0

TFSビルド定義のmsbuildプロセス中に復元されないNuGetパッケージの問題が発生しています。NuGetパッケージがTFSで復元されていない

私のソリューションには合計9個のNuGetパッケージがあり、9個のうち7個がパッケージフォルダから復元されているのがわかりますが、他の2個は復元されることはありません。パッケージはpackages.configにリストされ、対応するフォルダはビルドディレクトリに存在します。

このMS documentに記載されている追加のNuGet Restoreを追加しようとしましたが、手動でNuGetコマンドを手動で実行してみました。

追加詳細:

  • ソリューションは
  • NuGet.exeバージョンのプロジェクトファイルを持っていません。ネットのウェブサイトのためであるが2.8.60318.667
  • TFS 2015
  • MSBuildのです。 exe 14.0.23107
  • ターゲット設定.Net Framework 4.0(同じ結果を4.5でも試しました)
  • AWSSDK.CoreとAWSSDK.DynamoDBv2は復元されていません。 packages.configの

内容:

<?xml version="1.0" encoding="utf-8"?> 
<packages> 
    <package id="AWSSDK.Core" version="3.3.15" targetFramework="net40" requireReinstallation="true" /> 
    <package id="AWSSDK.DynamoDBv2" version="3.3.4.14" targetFramework="net40" requireReinstallation="true" /> 
    <package id="Microsoft.Bcl" version="1.1.10" targetFramework="net40" requireReinstallation="true" /> 
    <package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" /> 
    <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" /> 
    <package id="RestSharp" version="105.2.3" targetFramework="net40" requireReinstallation="true" /> 
    <package id="StackExchange.Redis" version="1.1.603" targetFramework="net40" requireReinstallation="true" /> 
    <package id="Twilio" version="4.7.2" targetFramework="net40" /> 
    <package id="Twilio.Lookups" version="1.1.0" targetFramework="net40" /> 
</packages> 

TFS出力から:

> Build started 6/29/2017 11:51:47 PM. 
>  1>Project "B:\site_agent\_work\4d978bf9\Site\Site.sln" on node 1 (default targets). 
>  1>ValidateSolutionConfiguration: 
>   Building solution configuration "Debug|Any CPU". B:\site_agent\_work\4d978bf9\Site\site.metaproj(0,0): Warning MSB3268: 
> The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the 
> currently targeted framework. ".NETFramework,Version=v4.5". To resolve 
> this problem, either remove the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> or retarget your application to a framework version which contains 
> "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>  1>Project "B:\site_agent\_work\4d978bf9\Site\Site.sln" (1) is building "B:\site_agent\_work\4d978bf9\Site\site.metaproj" (2) on node 
> 1 (default targets). 
>  2>B:\site_agent\_work\4d978bf9\Site\site.metaproj : warning MSB3268: The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the 
> currently targeted framework. ".NETFramework,Version=v4.5". To resolve 
> this problem, either remove the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> or retarget your application to a framework version which contains 
> "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
> B:\site_agent\_work\4d978bf9\Site\site.metaproj(0,0): Warning MSB3268: 
> The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Threading.Tasks, Version=4.0.0.0, 
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be 
> resolved in the currently targeted framework. 
> ".NETFramework,Version=v4.5". To resolve this problem, either remove 
> the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> or retarget your application to a framework version which contains 
> "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>  2>B:\site_agent\_work\4d978bf9\Site\site.metaproj : warning MSB3268: The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Threading.Tasks, Version=4.0.0.0, 
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be 
> resolved in the currently targeted framework. 
> ".NETFramework,Version=v4.5". To resolve this problem, either remove 
> the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll" 
> or retarget your application to a framework version which contains 
> "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
> B:\site_agent\_work\4d978bf9\Site\site.metaproj(0,0): Warning MSB3268: 
> The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Threading.Tasks, Version=4.0.0.0, 
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be 
> resolved in the currently targeted framework. 
> ".NETFramework,Version=v4.5". To resolve this problem, either remove 
> the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> or retarget your application to a framework version which contains 
> "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>  2>B:\site_agent\_work\4d978bf9\Site\site.metaproj : warning MSB3268: The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Threading.Tasks, Version=4.0.0.0, 
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be 
> resolved in the currently targeted framework. 
> ".NETFramework,Version=v4.5". To resolve this problem, either remove 
> the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> or retarget your application to a framework version which contains 
> "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
> B:\site_agent\_work\4d978bf9\Site\site.metaproj(0,0): Warning MSB3268: 
> The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the 
> currently targeted framework. ".NETFramework,Version=v4.5". To resolve 
> this problem, either remove the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> or retarget your application to a framework version which contains 
> "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>  2>B:\site_agent\_work\4d978bf9\Site\site.metaproj : warning MSB3268: The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the 
> currently targeted framework. ".NETFramework,Version=v4.5". To resolve 
> this problem, either remove the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll" 
> or retarget your application to a framework version which contains 
> "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
> B:\site_agent\_work\4d978bf9\Site\site.metaproj(0,0): Warning MSB3268: 
> The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the 
> currently targeted framework. ".NETFramework,Version=v4.5". To resolve 
> this problem, either remove the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> or retarget your application to a framework version which contains 
> "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>  2>B:\site_agent\_work\4d978bf9\Site\site.metaproj : warning MSB3268: The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the 
> currently targeted framework. ".NETFramework,Version=v4.5". To resolve 
> this problem, either remove the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> or retarget your application to a framework version which contains 
> "System.Runtime, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
> B:\site_agent\_work\4d978bf9\Site\site.metaproj(0,0): Warning MSB3268: 
> The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Threading.Tasks, Version=4.0.0.0, 
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be 
> resolved in the currently targeted framework. 
> ".NETFramework,Version=v4.5". To resolve this problem, either remove 
> the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> or retarget your application to a framework version which contains 
> "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>  2>B:\site_agent\_work\4d978bf9\Site\site.metaproj : warning MSB3268: The primary reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> could not be resolved because it has an indirect dependency on the 
> framework assembly "System.Threading.Tasks, Version=4.0.0.0, 
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be 
> resolved in the currently targeted framework. 
> ".NETFramework,Version=v4.5". To resolve this problem, either remove 
> the reference 
> "B:\site_agent\_work\4d978bf9\Site\packages\StackExchange.Redis.1.1.603\lib\net40\StackExchange.Redis.dll" 
> or retarget your application to a framework version which contains 
> "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\site\Bin\AjaxControlToolkit.dll" to 
> "site\\Bin\AjaxControlToolkit.dll". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll" 
> to "site\\Bin\Microsoft.Threading.Tasks.Extensions.Desktop.dll". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.xml" 
> to "site\\Bin\Microsoft.Threading.Tasks.Extensions.Desktop.xml". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll" 
> to "site\\Bin\System.IO.dll". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.xml" 
> to "site\\Bin\System.IO.xml". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll" 
> to "site\\Bin\System.Threading.Tasks.dll". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.xml" 
> to "site\\Bin\System.Threading.Tasks.xml". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Twilio.4.7.2\lib\3.5\Twilio.Api.dll" 
> to "site\\Bin\Twilio.Api.dll". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Twilio.4.7.2\lib\3.5\Twilio.Api.pdb" 
> to "site\\Bin\Twilio.Api.pdb". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Twilio.4.7.2\lib\3.5\Twilio.Api.xml" 
> to "site\\Bin\Twilio.Api.xml". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Twilio.Lookups.1.1.0\lib\3.5\Twilio.Lookups.dll" 
> to "site\\Bin\Twilio.Lookups.dll". 
>   Copying file from "B:\site_agent\_work\4d978bf9\Site\packages\Twilio.Lookups.1.1.0\lib\3.5\Twilio.Lookups.pdb" 
> to "site\\Bin\Twilio.Lookups.pdb". 
>   C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v 
> /localhost_55535 -p site\ -u -f 

答えて

0

解決策にプロジェクトファイルがないと、.refreshファイルをbinフォルダに追加しないかぎり、パッケージディレクトリからdllを自動的に復元しないようです。私がしたら、パッケージのdllのすべてが、msbuildがコンパイルを開始する前に、パッケージディレクトリ内のそれぞれのフォルダからbinフォルダへのソリューション用にコピーされていました。

ソリューションの概要:

  • TFS
  • にbinフォルダ内.refreshファイルを追加します
  • の実際のDLLを追加しないでくださいパッケージフォルダを確認し、それが内容はTFS
  • にチェックインされていますbinフォルダからTFS
  • TFSビルドステップをNuGetパッケージを復元するように設定します。
  • Webサイトコードのルートにpackages.configがあることを確認してください。
0

他のパッケージは、TFS build.Youを通じて回復することができた場合は、単に2つの特定を復元しようとすることができパッケージは9つではなくて

これは、誤ってプロジェクトのパッケージフォルダをいくつかの点でチェックしたために起こりました。そのため、ローカルNugetフォルダから来たように見えるものがプロジェクトのパッケージフォルダからコピーされていました。

もしそうなら、パッケージフォルダをTFSから削除して、やり直してください。

関連する問題