System.IO.FileLoadException
HResult=0x80131040
Message=Could not load file or assembly 'TimeZoneConverter, Version=3.3.0.0, Culture=neutral, PublicKeyToken=e20ab7d0d9479841'
or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=TimeZoneNames
StackTrace:
at TimeZoneNames.TZNames.GetNames(String timeZoneId, String languageKey, Boolean abbreviations)
at TimeZoneNames.TZNames.GetNamesForTimeZone(String timeZoneId, String languageCode)
…
In my app's build output, I found the following warning.
5> No way to resolve conflict between "TimeZoneConverter, Version=3.4.0.0, Culture=neutral, PublicKeyToken=e20ab7d0d9479841"
and "TimeZoneConverter, Version=3.3.0.0, Culture=neutral, PublicKeyToken=e20ab7d0d9479841".
Choosing "TimeZoneConverter, Version=3.4.0.0, Culture=neutral, PublicKeyToken=e20ab7d0d9479841" arbitrarily.
5> Consider app.config remapping of assembly "TimeZoneConverter, Culture=neutral, PublicKeyToken=e20ab7d0d9479841"
from Version "3.3.0.0" [] to Version "3.4.0.0" [(my-app-path)\bin\Debug\TimeZoneConverter.dll] to solve conflict and get rid of warning.
5>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5):
warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning
(or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TimeZoneConverter" culture="neutral" publicKeyToken="e20ab7d0d9479841" />
<bindingRedirect oldVersion="0.0.0.0-3.4.0.0" newVersion="3.4.0.0" />
</dependentAssembly>
</assemblyBinding>
And Visual Studio's Error List window showed the following.
Warning: Found conflicts between different versions of the same dependent assembly.
In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts;
otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TimeZoneConverter" culture="neutral" publicKeyToken="e20ab7d0d9479841" />
<bindingRedirect oldVersion="0.0.0.0-3.4.0.0" newVersion="3.4.0.0" />
</dependentAssembly>
</assemblyBinding>
Summary
Web.config
worked around the issue for menet48
as a target in the TimeZoneNames project file would help)More info
Details
The exception I encountered:
In my app's build output, I found the following warning.
And Visual Studio's Error List window showed the following.