Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=6.35.0.0. Nuget version mismatch Microsoft.IdentityModel.Abstractions #110865

Open
FrostNeptune opened this issue Dec 20, 2024 · 5 comments
Labels
area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner

Comments

@FrostNeptune
Copy link

FrostNeptune commented Dec 20, 2024

I am developing a C# dll based on .NET framework 4.8.2 which will use Microsoft Graph API to send email through outlook.
For this I have added the latest Nuget packages for “Microsoft.Graph” v5.67.0 and "Microsoft.Identity.Client" v4.66.2 . This is my csproj -

<ItemGroup>
    <PackageReference Include="Microsoft.Graph">
      <Version>5.67.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Identity.Client">
      <Version>4.66.2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Windows.Compatibility">
      <Version>9.0.0</Version>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json">
      <Version>13.0.1</Version>
    </PackageReference>
    <PackageReference Include="Std.UriTemplate" Version="2.0.1.0" />
    <PackageReference Include="Microsoft.CSharp">
      <Version>4.7.0</Version>
    </PackageReference>
  </ItemGroup>

The build is successfull but I am getting this runtime error -

### System.IO.FileLoadException: Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=6.35.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: ‘Microsoft.IdentityModel.Abstractions, Version=6.35.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’

Now, “Microsoft.Graph” v5.67.0 is dependent upon latest 'Microsoft.IdentityModel.Abstractions, Version=8.2.0.0 but I am not able to figure out which module is dependent upon 6.35.0.0.

Upon further looking, it is found out that, in obj/project.asset.json file there is a mismatch between 'Microsoft.IdentityModel components. “Microsoft.Graph.Core/3.2.1” is referring to “Microsoft.IdentityModel.Validators”: “8.2.0” but "Microsoft.Identity.Client/4.66.2"is referring to old 6.35.0 version.

Here is the obj/project.asset.json file -

"Microsoft.Graph/5.67.0": {
        "type": "package",
        "dependencies": {
          "Microsoft.Graph.Core": "3.2.1"
        },

"Microsoft.Graph.Core/3.2.1": {
        "type": "package",
        "dependencies": {
          "Microsoft.IdentityModel.Protocols.OpenIdConnect": "8.2.0",
          "Microsoft.IdentityModel.Validators": "8.2.0",
          "Microsoft.Kiota.Abstractions": "1.15.2",
          "Microsoft.Kiota.Authentication.Azure": "1.15.2",
          "Microsoft.Kiota.Http.HttpClientLibrary": "1.15.2",
          "Microsoft.Kiota.Serialization.Form": "1.14.0",
          "Microsoft.Kiota.Serialization.Json": "1.15.2",
          "Microsoft.Kiota.Serialization.Multipart": "1.14.0",
          "Microsoft.Kiota.Serialization.Text": "1.14.0",
          "System.Net.Http.WinHttpHandler": "6.0.0"
        },

"Microsoft.Identity.Client/4.66.2": {
        "type": "package",
        "dependencies": {
          "Microsoft.IdentityModel.Abstractions": "6.35.0",
          "System.Diagnostics.DiagnosticSource": "6.0.1"
        },

In Microsoft.Identity.Client/4.66.2 release note it is mentioned that it will work with “Microsoft.IdentityModel.Abstractions” >= 6.35.0 but in reality it is not.

app.config -

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.2.0.0" newVersion="8.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Kiota.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.15.2.0" newVersion="1.15.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.5" newVersion="8.0.0.5" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Memory.Data" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

packages.config -

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Azure.Core" version="1.44.1" targetFramework="net48" />
  <package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net48" />
  <package id="Microsoft.Bcl.TimeProvider" version="8.0.1" targetFramework="net48" />
  <package id="Microsoft.Graph" version="5.67.0" targetFramework="net48" />
  <package id="Microsoft.Graph.Core" version="3.2.1" targetFramework="net48" />
  <package id="Microsoft.Identity.Client" version="4.66.2" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.Abstractions" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.JsonWebTokens" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.Logging" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.Protocols" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.Tokens" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.IdentityModel.Validators" version="8.2.0" targetFramework="net48" />
  <package id="Microsoft.Kiota.Abstractions" version="1.15.2" targetFramework="net48" />
  <package id="Microsoft.Kiota.Authentication.Azure" version="1.15.2" targetFramework="net48" />
  <package id="Microsoft.Kiota.Http.HttpClientLibrary" version="1.15.2" targetFramework="net48" />
  <package id="Microsoft.Kiota.Serialization.Form" version="1.14.0" targetFramework="net48" />
  <package id="Microsoft.Kiota.Serialization.Json" version="1.15.2" targetFramework="net48" />
  <package id="Microsoft.Kiota.Serialization.Multipart" version="1.14.0" targetFramework="net48" />
  <package id="Microsoft.Kiota.Serialization.Text" version="1.14.0" targetFramework="net48" />
  <package id="Std.UriTemplate" version="2.0.1" targetFramework="net48" />
  <package id="System.Buffers" version="4.5.1" targetFramework="net48" />
  <package id="System.ClientModel" version="1.1.0" targetFramework="net48" />
  <package id="System.Diagnostics.DiagnosticSource" version="6.0.1" targetFramework="net48" />
  <package id="System.IdentityModel.Tokens.Jwt" version="8.2.0" targetFramework="net48" />
  <package id="System.Memory" version="4.5.5" targetFramework="net48" />
  <package id="System.Memory.Data" version="6.0.0" targetFramework="net48" />
  <package id="System.Net.Http.WinHttpHandler" version="6.0.0" targetFramework="net48" />
  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
  <package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net48" />
  <package id="System.Text.Json" version="8.0.5" targetFramework="net48" />
  <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
  <package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>

csproj -

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{94F3FFBE-B36A-43AE-813D-6F8AD4570654}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MicrosoftGraphAPIApp</RootNamespace>
    <AssemblyName>MicrosoftGraphAPIApp</AssemblyName>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <Deterministic>true</Deterministic>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
    <TargetFrameworkProfile />
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>
    <UpgradeBackupLocation />
    <TargetFrameworkProfile />
    <PublishUrl>publish\</PublishUrl>
    <Install>true</Install>
    <InstallFrom>Disk</InstallFrom>
    <UpdateEnabled>false</UpdateEnabled>
    <UpdateMode>Foreground</UpdateMode>
    <UpdateInterval>7</UpdateInterval>
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
    <UpdatePeriodically>false</UpdatePeriodically>
    <UpdateRequired>false</UpdateRequired>
    <MapFileExtensions>true</MapFileExtensions>
    <ApplicationRevision>0</ApplicationRevision>
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <UseApplicationTrust>false</UseApplicationTrust>
    <BootstrapperEnabled>true</BootstrapperEnabled>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <NuGetPackageImportStamp>
    </NuGetPackageImportStamp>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\..\..\..\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoWarn>1607</NoWarn>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\..\..\..\Release</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoWarn>1607</NoWarn>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
  </PropertyGroup>
  <PropertyGroup>
    <SignAssembly>true</SignAssembly>
  </PropertyGroup>
  <PropertyGroup>
    <AssemblyOriginatorKeyFile>..\..\..\Include\IRIS.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Azure.Core, Version=1.44.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Azure.Core.1.44.1\lib\net472\Azure.Core.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Bcl.TimeProvider, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Bcl.TimeProvider.8.0.1\lib\net462\Microsoft.Bcl.TimeProvider.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Graph, Version=5.67.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Graph.5.67.0\lib\netstandard2.0\Microsoft.Graph.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Graph.Core, Version=3.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Graph.Core.3.2.1\lib\net462\Microsoft.Graph.Core.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Identity.Client, Version=4.66.2.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Identity.Client.4.66.2\lib\net472\Microsoft.Identity.Client.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Abstractions, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.Abstractions.8.2.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.JsonWebTokens.8.2.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Logging, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.Logging.8.2.0\lib\net472\Microsoft.IdentityModel.Logging.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Protocols, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.Protocols.8.2.0\lib\net472\Microsoft.IdentityModel.Protocols.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.8.2.0\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Tokens, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.Tokens.8.2.0\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Validators, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.IdentityModel.Validators.8.2.0\lib\net472\Microsoft.IdentityModel.Validators.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Abstractions, Version=1.15.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Abstractions.1.15.2\lib\netstandard2.0\Microsoft.Kiota.Abstractions.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Authentication.Azure, Version=1.15.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Authentication.Azure.1.15.2\lib\netstandard2.0\Microsoft.Kiota.Authentication.Azure.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Http.HttpClientLibrary, Version=1.15.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Http.HttpClientLibrary.1.15.2\lib\net462\Microsoft.Kiota.Http.HttpClientLibrary.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Serialization.Form, Version=1.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Serialization.Form.1.14.0\lib\netstandard2.0\Microsoft.Kiota.Serialization.Form.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Serialization.Json, Version=1.15.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Serialization.Json.1.15.2\lib\netstandard2.0\Microsoft.Kiota.Serialization.Json.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Serialization.Multipart, Version=1.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Serialization.Multipart.1.14.0\lib\netstandard2.0\Microsoft.Kiota.Serialization.Multipart.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Kiota.Serialization.Text, Version=1.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Microsoft.Kiota.Serialization.Text.1.14.0\lib\netstandard2.0\Microsoft.Kiota.Serialization.Text.dll</HintPath>
    </Reference>
    <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
    <Reference Include="Std.UriTemplate, Version=2.0.1.0, Culture=neutral, PublicKeyToken=c118b0afb4598f9a, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\Std.UriTemplate.2.0.1\lib\netstandard2.0\Std.UriTemplate.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
    </Reference>
    <Reference Include="System.ClientModel, Version=1.1.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.ClientModel.1.1.0\lib\netstandard2.0\System.ClientModel.dll</HintPath>
    </Reference>
    <Reference Include="System.Core" />
    <Reference Include="System.Diagnostics.DiagnosticSource, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Diagnostics.DiagnosticSource.6.0.1\lib\net461\System.Diagnostics.DiagnosticSource.dll</HintPath>
    </Reference>
    <Reference Include="System.Drawing" />
    <Reference Include="System.IdentityModel" />
    <Reference Include="System.IdentityModel.Tokens.Jwt, Version=8.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.IdentityModel.Tokens.Jwt.8.2.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll</HintPath>
    </Reference>
    <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
    </Reference>
    <Reference Include="System.Memory.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Memory.Data.6.0.0\lib\net461\System.Memory.Data.dll</HintPath>
    </Reference>
    <Reference Include="System.Net.Http.WinHttpHandler, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Net.Http.WinHttpHandler.6.0.0\lib\net461\System.Net.Http.WinHttpHandler.dll</HintPath>
    </Reference>
    <Reference Include="System.Numerics" />
    <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
    </Reference>
    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
    </Reference>
    <Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
    </Reference>
    <Reference Include="System.Text.Json, Version=8.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Text.Json.8.0.5\lib\net462\System.Text.Json.dll</HintPath>
    </Reference>
    <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
    </Reference>
    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
      <HintPath>C:\IPS\v25.1\Source\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="IsolMicrosoftGraphAPIApp.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="..\..\..\Include\IRIS.snk">
      <Link>IRIS.snk</Link>
    </None>
    <None Include="app.config" />
    <None Include="packages.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Please advise me how to fix this error

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 20, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

@huoyaoyuan
Copy link
Member

NuGet versioning and assembly versioning are different systems. .NET Framework requires exact assembly version match. You need to ensure binding redirect is properly generated for the entry application.

@FrostNeptune
Copy link
Author

FrostNeptune commented Dec 23, 2024

NuGet versioning and assembly versioning are different systems. .NET Framework requires exact assembly version match. You need to ensure binding redirect is properly generated for the entry application.

@huoyaoyuan , can you please tell me how to check if binding redirects are properly generated.
Also I have added the app.config, packages.config and csproj files in the main question. Please have a look.

@huoyaoyuan
Copy link
Member

For your entry exe application, the ApplicationName.exe.config file should contain <bindingRedirect> elements as shown in the documentation.

If you are using the old .NET Framework project, you need to manually enable the auto generation following the documentation by setting <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>.

@FrostNeptune
Copy link
Author

@huoyaoyuan ,
Thanks for your reply. I have added app.config, packages.config and csproj files in the main question. Please have a look.

And below is the dll.config file -

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.2.0.0" newVersion="8.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Kiota.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.15.2.0" newVersion="1.15.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.5" newVersion="8.0.0.5" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Memory.Data" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

It is referring to the latest version of "Microsoft.IdentityModel.Abstractions" version 8.2.0.0 but Microsoft.Identity.Client v4.66.2.0 is referring to version 6.35.0. And I am still getting the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants