简体   繁体   中英

Method not found: 'Microsoft.Extensions.Primitives.StringValues Microsoft.AspNetCore.Http.IQueryCollection.get_Item(System.String)

When I try to run a HttpTrigger Azure Function V2 (Visual studio project) it blows up when I try to retrieve the Query part of the request url.

public static async Task<IActionResult> Run(
    [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
    ILogger log, ExecutionContext context)
{

    string clientId = req.Query["clientid"].ToString();

Method not found: 'Microsoft.Extensions.Primitives.StringValues Microsoft.AspNetCore.Http.IQueryCollection.get_Item(System.String)

I looked at this this post in github https://github.com/Azure/azure-functions-core-tools/issues/774 and downgraded to 2.1 Microsoft.Extensions.Configuration and it makes no difference.

Thanks!

弄清楚了,原来安装的NUGET软件包之一是预览版。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM