2016-04-07 8 views
4

TeamCityでアプリケーションをビルドするときに何らかの理由で、 "System.Runtime 4.0.20"をインストールしようとしています。Nuget Package Restore:.Net Version Error on Target

私は次のエラーを取得:それはパッケージを追加することを主張している理由私は理解できない

[update] WARNING: Package 'System.Runtime 4.0.20' does not exist in project 'AkkaNeat.Tests.csproj' [20:04:08][update] Removed package 'System.Resources.ResourceManager 4.0.0' from 'packages.config' [20:04:08][update] Removed package 'System.Linq 4.0.0' from 'packages.config' [20:04:08][update] For adding package 'System.Runtime 4.0.10' to project 'AkkaNeat.Tests.csproj' that targets 'net45'. [20:04:08][update] Could not install package 'System.Runtime 4.0.20'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. [20:04:08][update] Process exited with code 1 [20:04:09][Step 2/4] Step Restore NuGet packages (NuGet Installer) failed

を。 XamarinとVisual Studioの両方で、すべてのエージェントマシンが正常に構築されます。

私はこれを理解しようとして2日を過ごしました。私は、System.Runtimeの別のバージョンへの参照をpackages.jsonファイルに明示的に追加しようとしました。 Nugetはまだ指定されたバージョンを主張している。

答えて

4

インストールしようとしているパッケージが、プロジェクトが対象としている.Netのバージョンをサポートしていません。これを修正するには、プロジェクトがターゲットとする.Netバージョンを、System.Runtime 4.0.20パッケージ(サポートされている出力には表示されません)でサポートされている.Netバージョンに更新します。

手順1:パッケージがサポートする.Netのバージョンを確認します。

あなたのナゲットパッケージに必要なバージョンはlooking at the folder that it's installed underです。 /path/to/lib/net46またはpath/to/lib/net451の場合は、それぞれ.Net 4.6または.Net 4.5.1を意味します。

ステップ2:change your project's .Net version

+0

ありがとう。私は最終的にあなたの答えの助けを借りてそれを働かせました。 :) –

+0

あなたは歓迎です:) –