Skip to content

Fix: VS133 - Project templates are broken for .NET Framework#165

Merged
gasparnagy merged 4 commits intomainfrom
Fix_TemplatingIssues_133
Mar 23, 2026
Merged

Fix: VS133 - Project templates are broken for .NET Framework#165
gasparnagy merged 4 commits intomainfrom
Fix_TemplatingIssues_133

Conversation

@clrudolphi
Copy link
Copy Markdown
Contributor

🤔 What's changed?

When the generated project targets the .NET Framework:

  • Adjusted the generated .csproj to exclude the <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> lines
  • Exclude the ImplicitUsings.cs file
  • Add a using Renroll; line to the generated sample binding class.

⚡️ What's your motivation?

Fix #133

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "[vNext]" section of the CHANGELOG, linking to this pull request & included my GitHub handle to the release contributors list.

This text was originally taken from the template of the Cucumber project, then edited by hand. You can modify the template here.

…T Framework by omitting ImplicitUsings.cs and omitting nullable setting in .csproj file.
@clrudolphi clrudolphi requested a review from gasparnagy March 17, 2026 22:06
Copy link
Copy Markdown
Contributor

@gasparnagy gasparnagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great in general, but if we touch this...
As far as I have seen the thing we use here with the ImplicitUsings.cs is anyway obsolete. Nowadays the trendy way of adding implicit usings is with the <Using Include="some-namespace" /> MsBuild setting. For example the new MsTest wizard generates a project file like:

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

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <LangVersion>latest</LangVersion>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="MSTest" Version="4.0.1" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
  </ItemGroup>

</Project>

and no ImplicitUsings.cs. Could we just get rid of this extra file and use the MsBuild option? I think everything would be simpler then. Or shall we do it in a separate PR?

@clrudolphi
Copy link
Copy Markdown
Contributor Author

Could we just get rid of this extra file and use the MsBuild option?

Yes. Latest commit adopts this approach.

Also made a small adjustment so that the using statement for NUnit is NUnit.Framework.

Once we are satisfied with this PR, then we should also update all the references to the test frameworks to their latest version via separate PR before we push a new release of the Extension.

@clrudolphi
Copy link
Copy Markdown
Contributor Author

I'll also work on the dotnet new templates for similar fixes.

Copy link
Copy Markdown
Contributor

@gasparnagy gasparnagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@gasparnagy gasparnagy merged commit 150cd8b into main Mar 23, 2026
4 checks passed
@gasparnagy gasparnagy deleted the Fix_TemplatingIssues_133 branch March 23, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project templates are broken for .NET Framework

2 participants