Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WrikeWebHook causes exception on recent .NET versions #33

Closed
Oozza opened this issue Feb 14, 2022 · 3 comments
Closed

WrikeWebHook causes exception on recent .NET versions #33

Oozza opened this issue Feb 14, 2022 · 3 comments

Comments

@Oozza
Copy link

Oozza commented Feb 14, 2022

Using WrikeWebHook library on ASP.NET Core 3.0+ or Framework 5.0+ causes cast exception because recent ASP.NET doesn't use Newtonsoft.JSON library by default.

Solution is to use Microsoft.AspNetCore.Mvc.NewtonsoftJson package and add services.AddControllers().AddNewtonsoftJson(); in startup.cs program.

This applies to Visual Studio 2019 and ASP.NET MVC project type.
Can be reproduced by using WrikeWebHookControllerBase abstract class.

Thought it could be helpful to mention this in documentation. No need to change code.

@Oozza Oozza changed the title WrikeWebHook exception on recent .NET versions WrikeWebHook causes exception on recent .NET versions Feb 14, 2022
@staviloglu
Copy link
Owner

@Oozza it would be awesome if you could update the documentation and create PR

@Oozza
Copy link
Author

Oozza commented Mar 4, 2022

Sorry, I don't use Git. If I did I would edit Readme.md to include this text under Webhook section.

NOTE: WrikeApiClient uses Newtonsoft.json serializer, which is not default serializer on ASP.NET Core 3.0+ or Framework 5.0+ versions. On recent ASP.NET projects you may need to install Microsoft.AspNetCore.Mvc.NewtonsoftJson package and activate it with code like this.

services.AddControllers().AddNewtonsoftJson();

@staviloglu
Copy link
Owner

staviloglu commented Mar 5, 2022

Added to README.md, thanks @Oozza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants