Hello,
I create a new program with the following actions:
The solution compiles well but the creation of a instance of PdfDocument generates the following exception:
Could not load file or assembly ‘Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Te same process with a Console App (.NET Framework 4.8) project generates no exception.
What can I do to avoid this exception?
Best regards
Edit: Add solution files example zip.
It’s a dependency issue, not a Wisej issue.
The reason why it works in a console app and not in a Wisej app is because of this line here <Project Sdk="Microsoft.NET.Sdk.Web">
What this line does is that it essentially imports what is called a metapackage implicitly, named Microsoft.AspNetCore.App , and Microsoft.Extensions.Logging.Abstractions is part of it.
To fix it, add this to web.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-9.9.9.9" newVersion="8.0.0.2"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-9.9.9.9" newVersion="6.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Please login first to submit.