.net core 简单yo项目上的dotnet还原错误

.net core 简单yo项目上的dotnet还原错误,.net-core,yo,.net Core,Yo,运行在Fedorea 26上,我正在构建我的第一个dotnet核心asp应用程序。在接下来的教程中,当我尝试下面的dotnetrestore命令时,出现了一个错误 下面 我怀疑问题在于yo构建了dotnetcore1.x应用程序,但如下所示,我有dotnetcore2.0.0 这是否正确,如果正确,如何升级yo以构建dotnet 2.0项目? yo aspnet _-----_ ╭──────────────────────────╮ | | │ Welc

运行在Fedorea 26上,我正在构建我的第一个
dotnet核心asp
应用程序。在接下来的教程中,当我尝试下面的
dotnetrestore
命令时,出现了一个错误 下面

我怀疑问题在于
yo
构建了
dotnetcore1.x
应用程序,但如下所示,我有
dotnetcore2.0.0

这是否正确,如果正确,如何升级
yo
以构建dotnet 2.0项目?

yo aspnet

 _-----_     ╭──────────────────────────╮
|       |    │      Welcome to the      │
|--(o)--|    │  marvellous ASP.NET Core │
-----------'│        发电机!│
(U
)╰──────────────────────────╯ /A\/ |~|
“\ubr> '<代码>|°Y

? What type of application do you want to create? Empty Web Application
? What's the name of your ASP.NET application? WeatherMicroservice
   create WeatherMicroservice/.gitignore
   create WeatherMicroservice/Program.cs
   create WeatherMicroservice/Startup.cs
   create WeatherMicroservice/WeatherMicroservice.csproj
   create WeatherMicroservice/web.config
   create WeatherMicroservice/Properties/launchSettings.json
   create WeatherMicroservice/runtimeconfig.template.json
   create WeatherMicroservice/README.md
   create WeatherMicroservice/global.json


Your project is now created, you can use the following commands to get going
    cd "WeatherMicroservice"
    dotnet restore
    dotnet build (optional, build will also happen when it's run)
    dotnet run


[idf@localhost asp-core]$ cd WeatherMicroservice/
[idf@localhost WeatherMicroservice]$ dotnet restore

The specified SDK version [1.0.0-rc4-004771] from global.json [/home/idf/Documents/asp-core/WeatherMicroservice/global.json] not found; install specified SDK version
Did you mean to run dotnet SDK commands? Please install dotnet SDK from: 
  http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
这是已安装的
dotnet
版本:

[idf@localhost WeatherMicroservice]$ dotnet --info output:
The specified SDK version [1.0.0-rc4-004771] from global.json [/home/idf/Documents/asp-core/WeatherMicroservice/global.json] not found; install specified SDK version

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

[idf@localhost WeatherMicroservice]$ 
Yo仍然在线。还有一个升级到.NET Core 2.0的请求

您最好的选择可能是使用
dotnet new
。 您可以键入
dotnet new-l
列出所有可用模板。对于空的web应用程序项目
dotnet new web
。 您可以查看链接以了解有关
dotnet new

Yo仍处于启用状态的更多信息。还有一个升级到.NET Core 2.0的请求

您最好的选择可能是使用
dotnet new
。 您可以键入
dotnet new-l
列出所有可用模板。对于空的web应用程序项目
dotnet new web
。 有关
dotnet new

打开文件global.json的更多信息,请查看链接 请参阅以下内容:

{
"sdk": {
"version": "xxx.yyy.zzz"
}
}
现在,打开控制台并写下:

dotnet --version
您需要在json文件中写入此版本

打开文件global.json 请参阅以下内容:

{
"sdk": {
"version": "xxx.yyy.zzz"
}
}
现在,打开控制台并写下:

dotnet --version

您需要将此版本写入json文件

,否则将无法运行。当他尝试运行它时,它将尝试运行最新的SDK,但失败。它不会工作。当他尝试运行它时,它将尝试运行最新的SDK,但失败。