From 4121b2c26ce9215410c34690abba8de7e42eb52c Mon Sep 17 00:00:00 2001 From: Martin Carpentier Date: Sun, 14 Nov 2021 12:11:03 +0100 Subject: [PATCH 1/2] Create dotnet.yml --- .github/workflows/dotnet.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000..a73cc8bc --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,25 @@ +name: .NET + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal From 7b6cca5287dc0ad17be65659444d799fdc8a16e4 Mon Sep 17 00:00:00 2001 From: Martin Boje Carpentier Date: Thu, 27 Jan 2022 13:14:17 +0100 Subject: [PATCH 2/2] Updated the readme to point to geojson.text for system.text.json support --- .github/workflows/dotnet.yml | 25 ------------------------- README.md | 10 ++++++---- 2 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml deleted file mode 100644 index a73cc8bc..00000000 --- a/.github/workflows/dotnet.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: .NET - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal diff --git a/README.md b/README.md index 8b518018..2bf76685 100644 --- a/README.md +++ b/README.md @@ -28,15 +28,17 @@ Point point = JsonConvert.DeserializeObject(json); See the [Tests](https://github.com/GeoJSON-Net/GeoJSON.Net/tree/master/src/GeoJSON.Net.Tests) for more examples. -## Special considerations for ASP.Net Core 3+ +## Special considerations for ASP.Net Core 3.1+ -System.Text.Json is the default (recommended) serializer. GeoJSON.Net **does not play well with System.Text.Json**. Here are the recommended steps as a workaround: +System.Text.Json is the default (recommended) serializer. GeoJSON.Net **does not play well with System.Text.Json** and only supports Newtonsoft.Json + +[GeoJSON.Text](https://github.com/GeoJSON-Net/GeoJSON.Text) is a fork of this repository and have been developed to support System.Text.Json. + +If you still need to use Newtonsoft.Json in ASP.Net Core 3.1+, you must overwrite the default serializer. - add the "Microsoft.AspNetCore.Mvc.NewtonsoftJson" NuGet Package - add "services.AddControllers().AddNewtonsoftJson();" to your service configuration. -(Thanks for @jrowe88 for pointing this out) - ## Contributing Highly welcome! Just fork away and send a pull request. We try and review most pull requests within a couple of days. There is now a version 2.0.0 branch. I've created this ready for any breaking changes and any extra features and would encourage anything that isn't a bug fix to go in there.