LoginSignup
6
4

More than 5 years have passed since last update.

「'AutoMapper' にはすでに 'NETStandard.Library' に対して定義された依存関係があります。」の解決方法

Last updated at Posted at 2016-08-04

プロジェクトでAutoMapperを使用するために、Nugetでインストールしようとしたらタイトルのエラーメッセージが出た。

解決方法

Nugetのバージョンが古いため、最新にする。
自分は拡張機能を使っているため、

「ツール → 拡張機能と更新プログラム → 更新プログラム → Visual Studio ギャラリー」 から 「Nuget パッケージ マネージャー」を選択し、更新ボタンを押す。

拡張機能以外の解決方法

When running the NuGet pack command I get the error: 'AutoMapper' already has a dependency defined for 'NETStandard.Library'

に記載されてる方法では、

$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetNugetExe = "$(build.sourcesdirectory)/nuget.exe"
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
Set-Alias nuget $targetNugetExe -Scope Global -Verbose
nuget

でいけるらしい。ようはNuget置き換えろって話。

余談

ちなみに、.NETStandard.Libraryってのは、
.NET Core や .NET Framework や Windows Phone 等の.NET APIを共通化するAPIらしい。.NETStandard使えば、プラットフォーム気にしなくてすむよとの事(よくわかってないがたぶんそゆこと)

詳しくは、.NET Standard Library
に載ってるので読んでください。

6
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4