2017-10-12 8 views
1

Fedorea 26で実行中、私は初めてdotnet core aspアプリケーションを構築しています。 thisチュートリアルの後、私はdotnet restoreの下のコマンドを試してみると、以下のエラー が出ます。単純なプロジェクトでのドットネットの復元エラー

yodotnet core 1.xアプリケーションを作成していますが、下に示すように、私はdotnet core 2.0.0を持っているという疑いがあります。

もしそうなら、yoをアップグレードして、dotnet 2.0プロジェクトをビルドするにはどうすればよいですか?

yo aspnet 

_-----_  ╭──────────────────────────╮ 
|  | │  Welcome to the  │ 
|--(o)--| │ marvellous ASP.NET Core │ 

---------´ │ generator! │ (_´U _)╰──────────────────────────╯ / \/ | 〜|
」._ .'__
|° ´ 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 


[[email protected] asp-core]$ cd WeatherMicroservice/ 
[[email protected] 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のバージョンがインストールされている:

[[email protected] 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 

[[email protected] WeatherMicroservice]$ 

答えて

3

ASP.NET Core 1.0 RC4に残っています。また、.NETコア2.0にアップグレードするためのリクエストticketもあります。

おそらく最も良い選択肢はdotnet newです。 dotnet new -lと入力すると、使用可能なすべてのテンプレートを一覧表示できます。空のWebアプリプロジェクトdotnet new webの場合 dotnet newについての詳細はthisリンクをご覧ください。

0

ファイルを開くには、global.json はで書かれた内容を確認してください:

{ 
"sdk": { 
"version": "xxx.yyy.zzz" 
} 
} 

今、オープンコンソールと書き留め:

dotnet --version 

あなたはあなたのJSONファイルで、このバージョンを書く必要

関連する問題