问题
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