LoginSignup
0
2

More than 3 years have passed since last update.

msbuild で "Microsoft.Portable.CSharp.targets が見つかりませんでした" というエラーが出たときの対処

Posted at

Windows をクリーンインストールした後に Visual Studio 2019 を入れてソリューションを msbuild でビルドしたら下記のエラーが発生。

(中略)
"C:\Program Files (x86)\Microsoft Visual Studio\2019
\Enterprise\MSBuild\Microsoft\Portable
\v4.5\Microsoft.Portable.CSharp.targets" 
が見つかりませんでした。

どうやら PCL(Portable Class Library)のプロジェクトのビルドが失敗している模様。

原因と解決方法はこちら。

VS2019 の通常のインストールではもはや PCL はサポートされていなくて追加でコンポーネントを入れなければならないとのこと。

  1. Visual Studio Installer を起動する

  2. 変更 → 個別のコンポーネント → .NET ポータブルライブラリ対象パック にチェックを入れる

image.png

これをインストールした後は、冒頭のエラーは発生せず無事ビルドできました。

0
2
0

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
0
2