nunit/dotnet-new-nunit

dotnet new nunit -n "sample" is creating default project to .net5.0

Closed this issue · 3 comments

I downloaded the latst template version for nunit and the command dotnet new nunit -n "sample" is creating default project to .net5.0

below my xml

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

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>

    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NUnit" Version="3.12.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0"/>
  </ItemGroup>

</Project>

This is leading to missing assembly erros in projects.

jnm2 commented

The samples usually need to be customized. Is this different from any other dotnet project template?

The samples usually need to be customized. Is this different from any other dotnet project template?

Using vscode I only need to pass the target framework with --framework, but this change brokes visual studio template:
image
There is no way to change framework to netcore3.1. Only editing *.csproj by hand.

I notice this issue after visual studio ask to update the templates :(

By the docs in readme.md, the default framwork is netcoreapp3.1, but now, the default is net5.0.

Hi!
Yes, it is known, you can edit *.csproj manually for now.

This repository has been moved under support of .NET team to https://github.com/dotnet/test-templates
Moved project will be released with .NET 6.
I hope you can select target framework after release (btw .NET Framework will not be supported there).