「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。

-戻る
--[[NuGet]]
--[[MSBuild]]

* 目次 [#qd997202]
#contents

*概要 [#eae2b36d]
NuGetは非常に便利だが、この問題がよく起きるようになった。
-NuGetは非常に便利だが、この問題がよく起きるようになった。

-以下のようなメッセージが表示される。

--プライマリ参照 XXXX は、現在のターゲット フレームワークのバージョン "n.n.n.n" より~
高いバージョン "n.n.n.n" を持つ YYYYY に間接的に依存するため、解決できませんでした。

--The primary reference "XXXX", Version n.n.n.n, .....could not be resolved~
because it has an indirect dependency on the "YYYYY", Version n.n.n.n, .....~
which has a higher version "n.n.n.n" than the version n.n.n.n in the current target framework.

*詳細 [#d6dc14fa]

**原因 [#x2a9cd68]
-この問題は、NuGetパッケージのバージョンアップ作業などで、~
BCLと異なるフレームワーク バージョンで動き始めた場合に発覚したりする。

-[[netcoreapp>Nuget使用時に「warning MSB3247 Found conflicts between different versions of the same dependent assembly.」が発生#h22fa04f]]ではなく、バインディング リダイレクトがあるnetであっても、~
ピンポイントに特定バージョンのNuGetパッケージをインストールする必要があるケースもある。


**対応 [#m919ea50]
対応の一例として以下のような手順で解消したことがある。

-System.NetのNuGetパッケージをBCLのアセンブリに変更し、
-再構成(Microsoft.AspNet.WebApi.Clientを再インストール)

*参考 [#w12421fd]
-System.Net.Http Nuget assembly version is lower than built-in Visual Studio version · Issue #889 · Microsoft/dotnet~
https://github.com/Microsoft/dotnet/issues/889

-c# - Could not load file or assembly 'System.Net.Http.Formatting' or one of its dependencies. The system cannot find the path specified - Stack Overflow~
https://stackoverflow.com/questions/22403650/could-not-load-file-or-assembly-system-net-http-formatting-or-one-of-its-depen

----
Tags: [[:.NET開発]], [[:デプロイ]], [[:デバッグ]], [[:NuGet]]


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS