【问题标题】:Azure Functions and the new version of Microsoft.Data.SqlClient: is not supported on this platformAzure Functions 和新版本的 Microsoft.Data.SqlClient:此平台不支持
【发布时间】:2020-07-08 19:24:18
【问题描述】:

在我的 Azure Functions 中,我使用的是 Microsoft.EntityFrameworkCore 版本 3.1.4。今天我决定更新 nuget 包并将其更新到 3.1.5。另外,我更新了以下软件包:

<PackageReference Include="AzureExtensions.Swashbuckle" Version="3.2.2" />
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.1.7" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" 
                  Version="4.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" 
                  Version="3.1.5" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.8" />

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.5">

我使用的是 .NET Core 3.1

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

现在,在我的机器上,出现了这个错误:

此平台不支持 Microsoft.Data.SqlClient。

当我尝试创建新的 SqlParameters 时出现错误。

SqlParameter[] parameters = new SqlParameter[2];
parameters[0] = new SqlParameter("@todayOnly", SqlDbType.Bit) { Value = todayOnly };

我试图降级到以前的版本,但现在我收到了同样的错误。

我看到了其他帖子,例如 this one,但我认为这不是解决方案。

【问题讨论】:

  • 你如何打包和部署你的函数?
  • 我在本地有这个错误
  • 将函数包降级到 3.0.7
  • 它使用的是 3.1.4 版

标签: entity-framework-core azure-functions


【解决方案1】:

这是 Microsoft.NET.Sdk.Functions 3.0.8 中的一个错误。

https://github.com/Azure/azure-functions-vs-build-sdk/issues/436

解决方法是降级到 3.0.7

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-12
    • 2022-06-21
    • 2019-05-25
    • 2022-01-20
    • 2018-08-27
    • 1970-01-01
    • 2019-10-13
    • 1970-01-01
    相关资源
    最近更新 更多