1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

.NET6.0のSDKをインストールしたのに認識されない

Posted at

3.1から.NET6へのコンバートをすることになり、VisualStudio2022を使用したところ、次のようなエラーに遭遇しました。

error NETSDK1045: 現在の .NET SDK は、ターゲットとする .NET 6.0 をサポートしていません。.NET 5.0 以下をターゲットとするか、.NET 6.0 をサポートする .NET SDK のバージョンを使用してください。

VisualStudio for Mac 2022をインストールしただけだからかと思い、最新のSDK 6.0.400をインストールしたが、状況は変わらず同じメッセージが表示されます。

コンソールでSDKのインストール状況を確認すると

$ dotnet --list-sdks
:
3.1.422 [/usr/local/share/dotnet/sdk]
5.0.203 [/usr/local/share/dotnet/sdk]
:
5.0.408 [/usr/local/share/dotnet/sdk]
6.0.400 [/usr/local/share/dotnet/sdk]

念のため、別のバージョン(6.0.100)をインストールしたらエラーが出なくなり、ビルドも可能となりました。

$ dotnet --list-sdks
:
3.1.422 [/usr/local/share/dotnet/sdk]
5.0.203 [/usr/local/share/dotnet/sdk]
:
5.0.408 [/usr/local/share/dotnet/sdk]
6.0.100 [/usr/local/share/dotnet/sdk]
6.0.400 [/usr/local/share/dotnet/sdk]

複数のバージョンを入れたからなのか、特定バージョンが必要なのかまでは調べていませんが前進しましたのでご報告させていただきました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?