简单哟项目上的 dotnet 恢复错误
dotnet restore error on simple yo project
运行 Fedorea 26
,我正在构建我的第一个 dotnet core asp
应用程序。按照 this 教程,当我尝试 dotnet restore
下面的命令时出现错误
下面。
我怀疑问题是 yo
构建了一个 dotnet core 1.x
应用程序,但如下所示,我有 dotnet core 2.0.0
.
这是否正确,如果正确,我如何升级 yo
以构建 dotnet 2.0 项目?
yo aspnet
_-----_ ╭──────────────────────────╮
| | │ Welcome to the │
|--(o)--| │ marvellous ASP.NET Core │
---------´ │ generator! │
( _´U
_ )╰──────────────────────────╯
/A\/
| ~ |
'._.'__
´ |° ´ 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]$
哟还在ASP.NET Core 1.0 RC4. Also there is a request ticket升级到 .NET Core 2.0。
您最好的选择可能是使用 dotnet new
。
您可以键入 dotnet new -l
以列出所有可用模板。对于空的 Web 应用程序项目 dotnet new web
。
您可以查看 this link 了解有关 dotnet new
.
的更多信息
打开文件global.json
请看写了什么:
{
"sdk": {
"version": "xxx.yyy.zzz"
}
}
现在,打开控制台并记下:
dotnet --version
您需要在 json 文件中写入此版本
运行 Fedorea 26
,我正在构建我的第一个 dotnet core asp
应用程序。按照 this 教程,当我尝试 dotnet restore
下面的命令时出现错误
下面。
我怀疑问题是 yo
构建了一个 dotnet core 1.x
应用程序,但如下所示,我有 dotnet core 2.0.0
.
这是否正确,如果正确,我如何升级 yo
以构建 dotnet 2.0 项目?
yo aspnet
_-----_ ╭──────────────────────────╮
| | │ Welcome to the │
|--(o)--| │ marvellous ASP.NET Core │
---------´ │ generator! │
( _´U
_ )╰──────────────────────────╯
/A\/
| ~ |
'._.'__
´ |° ´ 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]$
哟还在ASP.NET Core 1.0 RC4. Also there is a request ticket升级到 .NET Core 2.0。
您最好的选择可能是使用 dotnet new
。
您可以键入 dotnet new -l
以列出所有可用模板。对于空的 Web 应用程序项目 dotnet new web
。
您可以查看 this link 了解有关 dotnet new
.
打开文件global.json 请看写了什么:
{
"sdk": {
"version": "xxx.yyy.zzz"
}
}
现在,打开控制台并记下:
dotnet --version
您需要在 json 文件中写入此版本