使用预览功能Visual Studio 中的预览语言 [英] Use preview features & preview language in Visual Studio

查看:118
本文介绍了使用预览功能Visual Studio 中的预览语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Visual Studio 中打开 C# 预览 功能?

<块引用>

可为空引用类型"功能目前处于预览状态且不受支持".要使用预览功能,请使用预览"语言版本.

项目属性不提供不支持的下一个 C# 版本预览(预览版)" 作为选项:

解决方案

概要

为了打开预览功能,您需要所有这些:

  • Visual Studio 预览版(推荐)
  • .NET 预览版(必需)
  • 更改项目应用程序设置
  • 更改项目构建设置

一步一步

  1. 下载
  2. 在项目中 → 属性 → 构建选择高级…(高级构建设置)
    选择所需的 C# 版本:

How can I turn on C# preview features in Visual Studio?

The feature 'nullable reference types' is currently in Preview and "unsupported". To use Preview features, use the 'preview' language version.

The project Properties does not offer "unsupported preview of next C# version (preview)" as an option:

解决方案

Synopsis

In order to turn on the preview features, you need all these:

  • Visual Studio preview (recommended)
  • .NET preview (required)
  • Change the Project Application settings
  • Change the Project Build settings

Step by Step

  1. Download Visual Studio 2019 Preview
  2. Download .NET SDK Preview for Visual Studio
  3. Check your installation from a cmd-line:

   > dotnet --list-sdks
   2.1.202 [C:\Program Files\dotnet\sdk]
   …
   2.2.101 [C:\Program Files\dotnet\sdk]
   3.0.100-preview6-012264 [C:\Program Files\dotnet\sdk]

  1. Right-click on your Project → Properties → Application
    Pick the Target Framework (note the link to Install other frameworks… as well)
  2. In Project → Properties → Build Select Advanced… (Advanced Build Settings)
    Select the desired C# version:

这篇关于使用预览功能Visual Studio 中的预览语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆