gpt4 book ai didi

macos - Mac 上的目标 .Netcore 2.1

转载 作者:行者123 更新时间:2023-12-04 23:56:34 25 4
gpt4 key购买 nike

如何在 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): error : The current .NET SDKdoes not support targeting .NET Standard 2.1. Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1. [/Users/user/Documents/Projects/vsCode/DotNet/AlexaDemo/data/data.csproj]"

Dotnet --info 返回

dotnet --info .NET Core SDK (reflecting any global.json): Version:
2.1.300 Commit: adab45bf0c

Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path:
/usr/local/share/dotnet/sdk/2.1.300/

Host (useful for support): Version: 2.1.0 Commit: caa7b7e2ba

.NET Core SDKs installed: 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 Core runtimes installed: 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]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

我在 Mac 上使用 vsCode 如果这有什么不同的话。谢谢

最佳答案

答案是目前还没有 dotnetstandard2.1。classlib 项目应以 NET Standard 2.0 为目标,console、mvc 和 api 项目应以 netcoreapp2.1 为目标。

关于macos - Mac 上的目标 .Netcore 2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50913136/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com