Nancy
Nancy copied to clipboard
Update to Net-standard 2.1 and update test project NuGet packages
Prerequisites
- [x] I have written a descriptive pull-request title
- [x] I have verified that there are no overlapping pull-requests open
- [x] I have verified that I am following the Nancy code style guidelines
- [x] I have provided test coverage for my change (where applicable)
Description
The projects are targeted to .NET Standard 2.1, 2.0 and .NET 4.5.2. Due to this change minimum version of the SDK project changed to 3.1.102 -> rollForward minor.
The AsyncUsageAnalyzers is not supported in .NET Standard 2.1 and it's outdated. I replaced it with Microsoft.VisualStudio.Threading.Analyzers package.
FakeItEasy, XUnit and Microsoft Test Framework SDK are updated to the latest version.
This PR will resolve #3007
Builds are failing on Travis and AppVeyor because of the .NET SDK and Mono version. I need to see how to fix them.
- Travis-ci: Distro has changed to Ubuntu bionic, Mono changed to 6.8.0 and dotnet SDK to 3.1.102
- Appveyor: image changed to VS2019
- PowerShell script: CakeVersion updated to 0.37.0
- Bash script: DOTNET_INSTALL_URL updated
- For both PowerShell and bash, there was a bug in regex that couldn't detect versions like x.x.x00.
- Cake: The project is using
dotnet testcommand.xunitcommand replaced withtestcommand and arguments changed to match dotnet test command. xunit.runner.visualstudio (2.4.1)will run the jobs fordotnet testcommand.Microsoft.NET.Test.Sdkversion changed to 15.5.0 from 16.5.0. The 16.5.0 version didn't copy testhost.dll to the output.
AppVeyor pipeline is passing now, there is a problem with Travis in OSXand Linux. I need to investigate more.
There is something interesting, Travis CI now supports .NET SDK 3.x.x by default. Why do we need to install it again?
By replacing AsyncUsageAnalyzers with Microsoft.VisualStudio.Threading.Analyzers there are +500 warnings about async usages. They are mostly in test projects.
The pipelines now compile fine. The tests are running fine Linux, OSX and on a local-machine. BrowserFixture.Should_return_JSON_serialized_form is failing on AppVeyor.
I don't know why. I have a parallel test on my own AppVeyor account. The tests are passing fine there!

By rerunning the build, everything works fine.
Why target .NET Standard 2.1? Nancy's not using any APIs from the standard. I'm failing to see what value it brings.
@khellang you are right about the APIs. It's not a must but shouldn't keep the project updated to be able to use the latest APIs? like support for Span<T> in case of refactoring for memory, CPU performance?