LoginSignup
0
1

More than 5 years have passed since last update.

mac > asp.net のカレントバージョン変更

Posted at

.NET Core のバージョンの選択

.NET Core のバージョンの選択は基本的に非推奨
理由は以下に記載

.NET Core のバージョンの選択 | Microsoft Docs

まれに、以前のバージョンの SDK を使用する必要がある場合があります。 そのバージョンは global.json ファイルで指定します。 "最新版を使用する" というポリシーは、インストールされている最新版より以前のバージョンの .NET Core SDK を指定するには global.json を使用することを意味します。

それでも変更したい

まずは変更可能なPCインストール済みのバージョンの確認

現バージョンの確認

> dotnet --version

3.0.100-preview-009812

変更可能なバージョンの確認

> dotnet --list-sdks

2.1.4 [/usr/local/share/dotnet/sdk]
2.1.300 [/usr/local/share/dotnet/sdk]
2.1.301 [/usr/local/share/dotnet/sdk]
2.1.302 [/usr/local/share/dotnet/sdk]
2.1.401 [/usr/local/share/dotnet/sdk]
2.1.500 [/usr/local/share/dotnet/sdk]
2.2.100 [/usr/local/share/dotnet/sdk]
3.0.100-preview-009765 [/usr/local/share/dotnet/sdk]
3.0.100-preview-009812 [/usr/local/share/dotnet/sdk]

設定ファイル global.json

カレントフォルダにglobal.jsonを作成

touch global.json

中身をいかにする。

{
  "sdk": {
    "version": "2.2.100"
  }
}

バージョンの確認

> dotnet --version

2.2.100

以上

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