Skip to content

Setup .NET Framework project

Romfos edited this page Mar 6, 2026 · 17 revisions

Warning

We recommend to use .NET 10+ runtime if possible. Use .NET Framework only if no other option.

.NET Framework project setup is the same as for .NET 10, but it require some additional configuration.

Main guide for project setup: Setup .NET 10 project with Gherkin support

1. Minimal supported version of .NET Framework is 4.8

Target framework should be at least net48. We recommend to use latest net481 if possible.

Official MS guide: Framework targeting overview

2. .NET SDK should be installed and used for project building

BddDotNet support only .NET project SDKs and uses Source Generators for Gherkin support

by this reason .NET 10+ SDK should be installed and used for building even if you are using .NET Framework as a runtime

3. Modern versions of Visual Studio are required

BddDotNet support only Visual Studio 2026+ or Visual Studio Code. Older versions of Visual Studio are not tested and not supported

4. Need to setup LangVersion project property

LangVersion should be set to 14 or latest. See more Configure C# language version. Example:

<Project>
  <PropertyGroup>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>
</Project>

Example of the full project file:

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks>net48</TargetFrameworks>
		<OutputType>Exe</OutputType>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<LangVersion>latest</LangVersion>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="BddDotNet" Version="2.1.0" />
		<PackageReference Include="BddDotNet.Gherkin.SourceGenerator" Version="2.1.0">
			<PrivateAssets>all</PrivateAssets>
			<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
		</PackageReference>
	</ItemGroup>

</Project>

Clone this wiki locally