簡體   English   中英

Azure函數.NetCore 3.0 Request.Query拋出“未找到入口點”錯誤

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

我有一個Azure Functions項目,可以在本地構建和運行。 我的一個方法嘗試訪問HttpRequest.Query類以獲取查詢字符串中的參數,該查詢字符串最近已經開始拋出錯誤,包括System.Private.CorLib:“未找到入口點”或

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

在此輸入圖像描述 有關為什么會發生這種情況的任何想法? 這是一個版本問題嗎?

通過刪除不需要的引用來解決

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM