Vu Tran Pham
Vu Tran Pham

Reputation: 13

How can I choose .NET Framework when create a NUnit Test Project with Visual Studio 2022?

In Visual Studio 2022, I can not find the .Net Framework option when creating a NUnit Test Project.

All options here

Please help me if there is any idea. Thank you.

I have tried with another computer and I can find this option, but on my computer, I can't.

Upvotes: 1

Views: 1033

Answers (2)

Sylvia
Sylvia

Reputation: 1022

You can also update your Test Project to target multiple frameworks by replacing

<TargetFramework>net6.0</TargetFramework>

with

<TargetFrameworks>net6.0;net8.0</TargetFrameworks>

When you do that, then a set of tests is created and run for each framework.

enter image description here

Upvotes: 0

PMF
PMF

Reputation: 17288

Just create it with .NET 6.0 or .NET 7.0 and change the line

<TargetFramework>net6.0</TargetFramework>

to

<TargetFramework>net4.8</TargetFramework>

in the newly created csproj file.

Upvotes: 1

Related Questions