System.Drawing.Common issues following upgrade

Hello,

I have just updated via Nuget from 24.3 to 24.5 and now I am unable to convert any HTML files. I get the following exception.

The application is a .NET Framework 4.8 class library.

FileLoadException: Could not load file or assembly ‘System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

  1. Why is it looking for such an old version?

My application already outputs version 7.0.22.51805 of System.Drawing.Common so I have tried adding the following binding redirect, but this also fails.

		<dependentAssembly>
			<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
			<bindingRedirect oldVersion="0.0.0.0-7.0.22.51805" newVersion="7.0.22.51805" />
		</dependentAssembly>

Any ideas?

Thanks,
Ryan

I have been able to resolve this with the following binding redirect.

		<dependentAssembly>
			<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
			<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
		</dependentAssembly>
1 Like

@rthomas95

Glad to know that the issue is resolved.