Home Articles

Mac上的目标.Netcore 2.1

Asked
Viewed 459 times
1

如何在Mac上定位.Net Core 2.1?当我将.csproj内容更改为目标netstandard2.1时,我收到以下错误

“/usr/local/share/dotnet/sdk/2.1.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(150,5):错误:当前的.NET SDK不支持定位.NET Standard 2.1 . 可以是.NET Standard 2.0或更低版本,也可以使用支持.NET Standard 2.1的.NET SDK版本 . [/ Users / user / Documents / Projects / vsCode / DotNet / AlexaDemo / data / data . 的csproj]”

Dotnet --info返回

dotnet --info .NET Core SDK(反映任何global.json):版本:2.1.300提交:adab45bf0c运行时环境:操作系统名称:Mac OS X OS版本:10.13操作系统平台:Darwin RID:osx.10.13-x64 Base路径:/usr/local/share/dotnet/sdk/2.1.300/主机(对支持很有用):版本:2.1.0提交:caa7b7e2ba已安装.NET Core SDK:2.0.0 [/ usr / local / share / dotnet / sdk] 2.1.4 [/ usr / local / share / dotnet / sdk] 2.1.300 [/ usr / local / share / dotnet / sdk]安装的.NET核心运行时:Microsoft.AspNetCore.All 2.1.0 [/ usr /local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.0 [ /usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1 . 0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]要安装其他.NET Core运行时或SDK:https://aka.ms/dotnet-download

我在Mac上使用vsCode,如果这有任何区别 . 谢谢

1 Answer

  • 0

    答案是到目前为止还没有dotnetstandard2.1 . classlib项目应该以.NET Standard 2.0为目标,而控制台,mvc和api项目应该以netcoreapp2.1为目标 .

Related