How to fix 'IMvcBuilder' does not contain a definition for 'AddNewtonsoftJson'
By FoxLearn 2/18/2024 9:45:32 AM 87
This post shows you how to fix 'Error CS1061 'IMvcBuilder' does not contain a definition for 'AddNewtonsoftJson' and no accessible extension method 'AddNewtonsoftJson' accepting a first argument of type 'IMvcBuilder' could be found (are you missing a using directive or an assembly reference?)'
To solve the problem you can right click on your project, then select Manage Nuget Packages => Install
Microsoft.AspNetCore.Mvc.NewtonsoftJson
Finally, you can call
services.AddControllers().AddNewtonsoftJson();
- ASP.NET Core: How to Create RDLC Report in ASP.NET Core
- How to fix Assets file 'project.assets.json' not found
- How to fix 'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer'
- How to set cookie ValidationInterval in ASP.NET Core
- How to fix LoginPath not working in ASP.NET Core
- How to fix Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager'
- How to Configure ASP.NET Core Identity password policy
- How to fix System.InvalidOperationException: Scheme already exists: Identity.Application
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024
What Are RESTful Web Services?
02/19/2024