ExtentReports | C# | .Net6
I am creating a package(via Azure pipeline) which is dependant on ExtentReports version 5.0.2. But, the NuGet package which gets created is not packed in .Net6 but it is packed in .Net framework instead.
Error message when i refer the package - Package 'PackageName 1.0.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.
When I use the projects dll(add the project in dependency/reference the project) it works fine.
In GAAC the NuGet package is showing (inside net45 it is supposed to be net6) - C:\Users\name.nuget\packages\packageName\1.0.3\lib\net45\packageName.dll
This package used to be created without any issue when using ExtentReports 4.1.0.
I have tried solutions suggested in similar posts but none of it worked for me.
I tried creating package from Visual Studio by right clicking on project and pack. This created the NuGet package under net6.0 - This proved the error was with Azure Pipeline.
Solution: Upgrade "NuGet tool installer" task