Tôi đã sử dụng Visual Studio Mac trong một thời gian ngắn và vừa cập nhật nó lên phiên bản đã phát hành. Tôi cũng đã tải xuống và cài đặt .NET Core 2.0 Preview 1. Từ dấu nhắc trình bao, tôi có thể tạo một dự án Web API mới:Visual Studio Mac không tương thích với lõi dotnet 2
dotnet2 davec$ dotnet --version
2.0.0-preview1-005977
dotnet2 davec$ dotnet new webapi
The template "ASP.NET Core Web API" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/template-3pn for details.
Processing post-creation actions...
Running 'dotnet restore' on dotnet2/dotnet2.csproj...
Restore succeeded.
Tôi có thể xây dựng và chạy dự án đó từ trình bao. Nhưng khi tôi mở nó trong Visual Studio cho Mac, cố gắng IDE và thất bại trong việc khôi phục:
Errors in dotnet2/dotnet2.csproj
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0'.
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0 (win)'.
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0 (win-x64)'.
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0 (win-x86)'.
NuGet Config files used:
~/.config/NuGet/NuGet.Config
Feeds used:
https://api.nuget.org/v3/index.json
Restore failed for 'Microsoft.NETCore.App (>= 2.0.0)'.
Restore failed.
https://gist.github.com/mrward/70b8132003ef77d893111ecbea3e2225#net-core-app-20-project – jmoerdyk
Cảm ơn 'RuntimeFrameworkVersion' đã giải quyết vấn đề cho tôi. –