简体   繁体   English

错误:无法加载文件或程序集 'Microsoft.Extensions.DependencyInjection.Abstractions,版本 = 3.1.0.0,在 Azure function 1

[英]Error: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0, in Azure function 1

I am getting following error while using microsoft.powerplatform.dataverse.client nuget package in my Azure function(type 1, .net framework 4.8) .在我的Azure function(type 1, .net framework 4.8)中使用microsoft.powerplatform.dataverse.client nuget package 时出现以下错误。 I am using above nuget package to retrieve information from Ms Dynamics CRM .我正在使用上面的 nuget package 从Ms Dynamics CRM检索信息。 This error only comes at runtime, not during compile time.此错误仅在运行时出现,而不是在编译时出现。 Please help for the same.请帮助相同。

Error:错误:

Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=abc' or one of its dependencies. The system cannot find the file specified.

I have tried adding Microsoft.Extensions.DependencyInjection.Abstractions , Version=3.1.8.0 in solution.我尝试在解决方案中添加Microsoft.Extensions.DependencyInjection.Abstractions , Version=3.1.8.0 。 I could not downgrade it to Version 3.1.0.0 because microsoft.powerplatform.dataverse.client package needs Version >=3.1.8.0.我无法将其降级到版本 3.1.0.0,因为microsoft.powerplatform.dataverse.client package 需要版本 >=3.1.8.0。

Check the below steps to Install and use the Nuget Package ` microsoft.powerplatform.dataverse.client .检查以下步骤以安装和使用 Nuget Package ` microsoft.powerplatform.dataverse.client

  • Created an Azure Function with .NET Framework v1 .使用.NET Framework v1创建了一个 Azure Function 。

在此处输入图像描述

  • when I tried to add microsoft.powerplatform.dataverse.client NuGet Package, got the below error.当我尝试添加microsoft.powerplatform.dataverse.client NuGet Package 时,出现以下错误。

在此处输入图像描述

  • As suggested in the error message, added Newtonsoft.Json version 13.0.1 package.根据错误消息中的建议,添加了Newtonsoft.Json version 13.0.1 package。
  • Now I am able to build and install the microsoft.powerplatform.dataverse.client package without any issue but got the compile time Assembly warning.现在我可以毫无问题地构建和安装microsoft.powerplatform.dataverse.client package,但会收到编译时程序集警告。
Detected package version outside of dependency constraint: Microsoft.NET.Sdk.Functions 1.0.24 requires Newtonsoft.Json (= 9.0.1) but version Newtonsoft.Json 13.0.1 was resolved.

在此处输入图像描述

  • Even installed the NuGet package Microsoft.Extensions.DependencyInjection.Abstractions which you have installed as an add on.甚至安装了 NuGet package Microsoft.Extensions.DependencyInjection.Abstractions ,您已将其作为附加组件安装。
  • I am able to run and access the Function locally without any issue.我能够在本地毫无问题地运行和访问 Function。

My.csproj file我的.csproj文件

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <AzureFunctionsVersion>v1</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" />
    <PackageReference Include="Microsoft.PowerPlatform.Dataverse.Client" Version="1.0.26" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

Local Output本地 Output 在此处输入图像描述在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集 Microsoft.Extensions.DependencyInjection.Abstractions,版本 = 1.1.0.0 - Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0 无法加载文件或程序集 Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0 - Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0 无法加载文件或程序集“Microsoft.Extensions.DependencyInjection.Abstractions” - Cannot load file or asembly 'Microsoft.Extensions.DependencyInjection.Abstractions' 无法安装包'Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0' - Could not install package 'Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0' 无法安装包&#39;Microsoft.Extensions.DependencyInjection.Abstractions 2.0.0 - Could not install package 'Microsoft.Extensions.DependencyInjection.Abstractions 2.0.0 无法在 MSTest 项目中加载文件或程序集“Microsoft.Extensions.Configuration.Abstractions,Version=3.1.0.0” - Cannot load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0' in MSTest project 无法加载文件或程序集 Microsoft.Extensions.DependencyInjection,版本=1.1.0.0 - Could not load file or assembly Microsoft.Extensions.DependencyInjection, Version=1.1.0.0 Azure function v4 迁移。 无法加载文件或程序集 'Microsoft.Extensions.Configuration.Abstractions,Version=7.0.0.0,Culture=neutral - Azure function v4 migration. Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=7.0.0.0, Culture=neutral Azure 中的 Function 应用程序无法加载文件或程序集“Microsoft.Extensions.Logging.Abstractions” - Function app in Azure could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions' 无法加载程序集 Microsoft.Extensions.Configuration.Abstractions 3.1.0.0 但我正在参考 3.1.5.0 - Could not load assembly Microsoft.Extensions.Configuration.Abstractions 3.1.0.0 but I am making reference to 3.1.5.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM