Azure Functions .NetCore 3.0 Request.Query throwing “Entry point not found” error

徘徊边缘 提交于 2021-01-29 12:12:34

问题


I have an Azure Functions project which builds and runs locally. One of my methods tries to access the HttpRequest.Query class to get parameters in the querystring which as of recently has started throwing errors including System.Private.CorLib: "Entry point not found" or

System.Private.CoreLib: Exception while executing function: Configurations_Get. 
BC.Functions: Method not found: 'Microsoft.Extensions.Primitives.StringValues 
Microsoft.AspNetCore.Http.IQueryCollection.get_Item(System.String)'.

The code of the function follows:

[FunctionName("Configurations_Get")]
    public static async Task<IActionResult> GetConfigs(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route=ROUTE)]
        HttpRequest req,
        [Table("configurations", Connection = "AzureWebJobsStorage")] CloudTable configTable,
        ILogger log)
    {
        log.LogInformation("Getting configuration");
        string version = "1.0";
        try
        {
            var query = req.Query;
            version = query["version"];
        }
        catch (Exception e)
        {
            version = "1.0";
            Console.WriteLine(e.Message);
        }

       ....
    }

Nuget versions as following

Any ideas on why this is happening? Is it a versioning issue?


回答1:


solved by removing unneeded references to

Microsoft.AspNetCode.Components.Browser
Microsoft.AspNetCode.Identity
Microsoft.NETCore.Platforms


来源:https://stackoverflow.com/questions/56242212/azure-functions-netcore-3-0-request-query-throwing-entry-point-not-found-erro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!