Azure / Azure/azure-functions-host

JsonResult with JsonSerializerSettings throws exception in .NET Core 3.1 / Azure Functions v3

Open
#7,102 14 comments 0 reactions 0 assignees View on GitHub
needs-investigation
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

Hi All ,
I refered to this issue : https://github.com/Azure/azure-functions-host/issues/5376

But I still cannot solve it . My Azure function works fine locally but it gives following error when I deploy on Azure Portal using Azure pipeline .
Method not found: 'Void Microsoft.AspNetCore.Mvc.JsonResult..ctor

Function App version: 3.0
Function App runtime: .Net Core 3.1

Hosted info:
Runtime: 3.0.15193.0 (~3)
Location: West Europe
Platform: App Service Plan (Y1: 0)
OS: Windows

I have added reference to nuget Microsoft.AspNetCore.Mvc.NewtonsoftJson and set FUNCTIONS_V2_COMPATIBILITY_MODE as true.
This was working fine when I used Azure function v2 and .net core 2.1 .But stopped working when I upgraded it.
Can you please help what can be wrong ?

With Regards,
Nikhil Rai

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by reproducing the JsonResult constructor failure with Microsoft.AspNetCore.Mvc.NewtonsoftJson under Azure Functions v3 and .NET Core 3.1, then compare deployed dependencies with the local environment; done requires a confirmed compatible configuration or host fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.