c# - Entity Framework Core 导致无法加载 netstandard

标签 c# azure

我在 Visual Studio 2019 版本 16.5.0 Preview 1 中使用 .NET Core 3.1 运行带有 Http 触发器的 Azure 函数,但出现以下错误:

The 'HttpTriggerCSharp' function is in error: Unable to load one or more of the requested types. [12/25/2019 9:32:30 PM]

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. [12/25/2019 9:32:30 PM]

Microsoft.Azure.WebJobs.Host: Error indexing method 'HttpTriggerCSharp'. Microsoft.Azure.WebJobs.Host: cannot bind parameter 'log' to type ILogger. Make sure the parameter type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

当我安装 Microsoft.EntityFrameworkCore.SqlServer 的 nuget 包时出现错误。

知道如何解决这个问题吗?

最佳答案

事实证明,我正在运行 Azure Function 运行时的 v2,当我在 FunctionApp1.csproj 文件中将其更改为 v3 时,它开始工作。

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>

关于c# - Entity Framework Core 导致无法加载 netstandard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59482013/

相关文章:

c# - 使用unity C#设置 Material 颜色

c# - 在 .Net 中使用 GraphQL 客户端库的 AWS Appsync 实现

Azure ACS - 中继方应用程序 - 带参数的 ReturnURL?

Azure应用服务-添加自定义域名而不回收

azure - 我可以限制*特定*事件函数的并发吗?

azure - azure 服务器上的原始sql;如何从 SELECT 语句检索结果?

c# - 我怎么知道在发送打印命令(按下 "Ctrl+P"按钮)后我应该等待 PrintDialog 多长时间?

c# - 为什么 C# EF Core 会删除使用 block 之间的值?

c# - 使用 WCF 客户端 + cookie 进行 Web 服务调用

python - 如何更快地从azure documentdb获取数据