Reputation: 101
I run the code
dotnet new global.json --sdk-version 3.1.408
but I need to downgrade sdk-version 3.1.0
I deleted global.json folder again
project are developed in ASP .NetCore 3.1
then I try the dotnet new globaljson --sdk-version 3.1.0
If I run dotnet aspnet-codegenerator controller -name EmployeeController -m Employee -dc AppDbContext --relativeFolderPath Controllers --useDefaultLayout --referenceScriptLibraries
I got the following error:
A compatible installed .NET Core SDK for global.json version [3.1.0] from [/home/dir_name/app1/global.json] was not found Install the [3.1.0] .NET Core SDK or update [dir_name/app1/global.json] with an installed .NET Core SDK: 3.1.408 [/snap/dotnet-sdk/123/sdk]
Upvotes: 0
Views: 223
Reputation: 21526
As the error message said, the 3.1.0 .NET Core SDK was not found, I assume you didn't install the 3.1.0 version .NET Core SDK.
Try to use the following command to check the installed SDK version:
dotnet --list-sdks
Then, you could download the 3.1.0 version .NET Core SDK and Runtime and install it.
Upvotes: 1