如何删除消息“您正在使用.NET Core SDK的预览版"; [英] how to remove message "You are working with a preview version of the .NET Core SDK"
本文介绍了如何删除消息“您正在使用.NET Core SDK的预览版";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我重建解决方案时,出现消息
When I rebuild solution, message appears
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
I created a global.json containing
{
"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中
In my .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的当前版本并删除该烦人的消息?
After changing the dotnet version by doing the above, I still get the message when I rebuild solution. How do I change the current version of .net core sdk I am using and remove that annoying message?
推荐答案
在github上查看此PR: https://github.com/dotnet/sdk/pull/2042
See this PR on github: https://github.com/dotnet/sdk/pull/2042
基本上,您可以在.csproj文件中执行以下操作:
Basically you could do the following in your .csproj file:
<PropertyGroup>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
这篇关于如何删除消息“您正在使用.NET Core SDK的预览版";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文