无法创建摘要 class?

Cannot create an abstract class?

我正在尝试 运行 firebase 在本地运行,但出现错误:

Exception while executing function: Functions.TestMe. Microsoft.Azure.WebJobs.Host: One or more errors occurred. Exception binding parameter 'req'. mscorlib: Cannot create an abstract class.

我在 VSCode 中有一个只有这个功能的 azure 云函数项目:

using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs.Host;
using Newtonsoft.Json;

using MongoDB.Bson;
using MongoDB.Driver;

namespace Learning.Platform
{
    public static class TestMe
    {
        [FunctionName("TestMe")]
        public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequest req, TraceWriter log)
        {
            log.Info("C# HTTP trigger function processed a request.");

            var db = new MongoClient(/*snipped*/);
            var hey = db.GetDatabase("dude").GetCollection<object>("hey");

            return (ActionResult)new OkObjectResult($"Hello, {hey}");
        }
    }
}

我原以为这会起作用,因为它是 azure 函数的一个相当基本的示例。

我正在使用 Azure .net SDK 2.9 版、Azure 工具 1.3.0 和 .Net Core 2.0 框架。

我沮丧地放弃了,卸载了 .net 核心框架和 azure 工具,然后重新安装。

问题自行解决。

Azure 存储组件中存在问题 - 我 运行 遇到了与我尝试 运行 Web 作业相同的问题 - 但 Azure 存储团队修复了它

对于遇到此问题的任何人。我有同样的问题,并且能够解决它。我 运行 在试图搞砸并针对 azure 函数运行时的 v2 创建一个 F# HttpTrigger 函数时参与其中(因为他们还没有模板...)。

无论如何,我的问题是我在对其他问题进行故障排除时将 System.AspNetCore.Http Nuget 包安装到了我的项目中。删除对 Nuget 包的引用后(只留下 Microsoft.NET.Sdk.Functions)它又开始工作了。