Sicos1977 / IFilterTextReader

A reader that gets text from different file formats through the IFilter interface
Other
55 stars 38 forks source link

Registry DLL issue after upgrading #38

Closed richardtallent closed 4 years ago

richardtallent commented 5 years ago

I have a web site with an assembly targeting .NET 4.7.2, running on IIS. It is using IFilterTextReader 1.6.4 (installed via NuGet, confirmed the DLL version on the server), and it also has a dependency for Microsoft.Win32.Registry 4.6.0.

But when I try to use this library, I get the following error:

Could not load file or assembly 'Microsoft.Win32.Registry, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)<br> at IFilterTextReader.FilterLoader.ReadFromHKLM(String key, String value) [...]

I tried adding the following to my web.config file, it didn't help:

<dependentAssembly>
    <assemblyIdentity name="Microsoft.Win32.Registry" />
    <bindingRedirect oldVersion="1.0.0.0-4.6.0.0" newVersion="4.6.0.0" />
</dependentAssembly>

I also manually replaced the DLLs on my web server with both the lib\netstandard2.0 and lib\net461 versions straight from my packages folder, it didn't help.

I don't get why it's asking for v4.1.1.0, when the current version should be targeting netstandard 2.0, which is v.4.5 or higher? And why the web.config override isn't working?

I'm sure I'm doing something wrong, I've been a .NET developer since the early 1.0 betas, and the DLL hell of .NET vs. .NET Standard vs. .NET Core still confuses the hell out of me.

Any suggestions?

richardtallent commented 4 years ago

This issue can be closed... if anyone else runs into this, apparently version redirects must be specified in both the web.config file and the various DLLs' app.config files that reference that DLL.