Skip to content

Commit 6a1b3e7

Browse files
authored
System.Text.Json workaround in .netCore 3
1 parent 79b025a commit 6a1b3e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ Point point = JsonConvert.DeserializeObject<Point>(json);
2828

2929
See the [Tests](https://github.com/GeoJSON-Net/GeoJSON.Net/tree/master/src/GeoJSON.Net.Tests) for more examples.
3030

31+
## Special considerations for ASP.Net Core 3+
32+
33+
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:
34+
35+
- add the "Microsoft.AspNetCore.Mvc.NewtonsoftJson" NuGet Package
36+
- add "services.AddControllers().AddNewtonsoftJson();" to your service configuration.
37+
38+
(Thanks for @jrowe88 for pointing this out)
3139

3240
## Contributing
3341
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.

0 commit comments

Comments
 (0)