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

本文是小编为大家收集整理的关于在Visual Studio中使用预览功能和预览语言的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

如何打开 c# preview 在Visual Studio中的功能?

当前在预览中和"不支持"的功能"无效参考类型".要使用预览功能,请使用"预览"语言版本.

项目 properties 不提供"下一个C#版本(Preview)的不支持的预览" 作为选项: 无预览C夏普预览

推荐答案

概要

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

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

逐步

  1. 下载 Visual Studio 2019 Preview
  2. 下载 .net sdk preview for Visual Studio for Visual Studio
  3. 从CMD线检查您的安装:
   > 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. 右键单击您的项目→属性→应用程序
    选择目标框架 (请注意安装其他框架的链接……)  .net core 3.0
  2. 项目→属性→构建 选择高级…(高级构建设置)
    选择所需的C#版本:

其他推荐答案

我的情况我需要检查此复选框(并重新启动Visual Studio!)

在此处输入图像描述

本文地址:https://www.itbaoku.cn/post/2343612.html

问题描述

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: No preview C sharp preview available

推荐答案

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) .NET Core 3.0
  2. In Project → Properties → Build Select Advanced… (Advanced Build Settings)
    Select the desired C# version: Unsupported preview of next C sharp version

其他推荐答案

I my case I needed to check this checkbox (and restart Visual Studio!)

enter image description here