NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.16k stars 1.47k forks source link

Update to Net-standard 2.1 and update test project NuGet packages #3008

Open 0x414c49 opened 4 years ago

0x414c49 commented 4 years ago

Prerequisites

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

0x414c49 commented 4 years ago

Builds are failing on Travis and AppVeyor because of the .NET SDK and Mono version. I need to see how to fix them.

0x414c49 commented 4 years ago

AppVeyor pipeline is passing now, there is a problem with Travis in OSXand Linux. I need to investigate more.

0x414c49 commented 4 years ago

There is something interesting, Travis CI now supports .NET SDK 3.x.x by default. Why do we need to install it again?

0x414c49 commented 4 years ago

By replacing AsyncUsageAnalyzers with Microsoft.VisualStudio.Threading.Analyzers there are +500 warnings about async usages. They are mostly in test projects.

0x414c49 commented 4 years ago

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.

0x414c49 commented 4 years ago

I don't know why. I have a parallel test on my own AppVeyor account. The tests are passing fine there!

image

0x414c49 commented 4 years ago

By rerunning the build, everything works fine.

khellang commented 4 years ago

Why target .NET Standard 2.1? Nancy's not using any APIs from the standard. I'm failing to see what value it brings.

0x414c49 commented 4 years ago

@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?