Azure函数.NetCore 3.0 Request.Query抛出“找不到入口点";错误 [英] Azure Functions .NetCore 3.0 Request.Query throwing "Entry point not found" error

查看:77
本文介绍了Azure函数.NetCore 3.0 Request.Query抛出“找不到入口点";错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Azure Functions项目,该项目在本地构建和运行.我的方法之一尝试访问HttpRequest.Query类以获取querystring中的参数,而该参数最近已经开始引发错误,包括System.Private.CorLib:找不到入口点"或

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)'.

该函数的代码如下:

[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版本如下

有什么想法为什么会这样?是版本问题吗?

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

推荐答案

通过删除对

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

这篇关于Azure函数.NetCore 3.0 Request.Query抛出“找不到入口点";错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆