gpt4 book ai didi

asp.net-core - 如何删除消息 "You are working with a preview version of the .NET Core SDK"

转载 作者:行者123 更新时间:2023-12-02 05:29:59 24 4
gpt4 key购买 nike

当我重建解决方案时,出现消息

    You are working with a preview version of the .NET Core SDK. You can define the SDK version via a global.json file in the current project

我创建了一个包含的 global.json

    {
"sdk": {
"version": "2.1.4"
}
}

然后在cli中,

    dotnet --version

输出

    2.1.4

然后在cli中,

    dotnet --list-sdks

输出

    2.1.4 [C:\Program Files\dotnet\sdk]
2.1.100 [C:\Program Files\dotnet\sdk]
2.1.101 [C:\Program Files\dotnet\sdk]
2.1.102 [C:\Program Files\dotnet\sdk]
2.1.103 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.200-preview-007474 [C:\Program Files\dotnet\sdk]
2.1.200-preview-007576 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.300-preview2-008533 [C:\Program Files\dotnet\sdk]

在我的 .csproj 中

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.4" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.5.4" />
</ItemGroup>

<ItemGroup>
<Content Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

通过执行上述操作更改 dotnet 版本后,在重建解决方案时我仍然收到消息。如何更改我正在使用的 .net core sdk 当前版本并删除该烦人的消息?

最佳答案

请参阅 github 上的此 PR:https://github.com/dotnet/sdk/pull/2042

基本上,您可以在 .csproj 文件中执行以下操作:

<PropertyGroup>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

关于asp.net-core - 如何删除消息 "You are working with a preview version of the .NET Core SDK",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50423404/

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