SpecFlowOSS / SpecFlow.VS

The next version of the Visual Studio extension for SpecFlow
MIT License
39 stars 12 forks source link

Project created with the "SpecFlow Project" template produces compiler error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. #128

Open icnocop opened 1 year ago

icnocop commented 1 year ago

Used Visual Studio

Visual Studio 2022

Are the latest Visual Studio updates installed?

Yes

Issue Description

When creating a new project using the "SpecFlow Project" template, which targets .NET Framework 4.7.2, the following compiler error occurs when building: CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater.

Steps to Reproduce

  1. Launch Visual Studio 2022 17.5.0
  2. File > New Project > SpecFlow Project > Next
  3. Create
  4. Framework: .NET Framework 4.7.2
  5. Test Framework: MSTest
  6. Uncheck "Add FluentAssertions library"
  7. Create
  8. Build the solution

Notice the following compiler error occurs: CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater.

I expected the project to build without errors.

SpecFlow for Visual Studio 2022 v2022.1.91.26832 - 2022-12-20

As a work-around, edit the generated project file and add the following within <PropertyGroup> <LangVersion>latest</LangVersion>