Program running on Windows 7 will hit exception after installed Microsoft Windows Security Update (KB4537820). “Message Exception has been thrown by the target of an invocation.”

Any one could help on this? Thank you.

This happen in the following code
System.Resources.ResourceManager.OpenObject(“ObjectName) with .NET framework 4.6

Problem Description:
Program running on Windows 7 will hit exception after installed Microsoft Windows Security Update (KB4537820).
“Message Exception has been thrown by the target of an invocation.”

Pre-requisites:
Run .net program (Framework 4.6) on Windows 7 machine.
Install Microsoft Windows Security Update (KB4537820).


Problem Analysis:
When program load the icon  from ResourceManager, it will throw the exception message. 
“Message Exception has been thrown by the target of an invocation.”
 

Detail update as below.
https://support.microsoft.com/en-my/help/4537820/windows-7-update-kb4537820

This update on apply to client that purchase ESU from Microsoft.

https://www.zdnet.com/article/bypass-discovered-to-allow-windows-7-extended-security-updates-on-all-systems/

Message              Exception has been thrown by the target of an invocation.           

Exception                           

Exception Type System.Reflection.TargetInvocationException    

Message              Exception has been thrown by the target of an invocation.           

Stack Trace         "   at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)

   at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)

   at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)

   at System.Runtime.Serialization.ObjectManager.DoFixups()

   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)

   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)

   at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)

   at System.Resources.ResourceReader._LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)

   at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)

   at System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode& typeCode)

   at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)

   at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase)

   at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)

   at System.Resources.ResourceManager.GetObject(String name)


InnerException "System.ComponentModel.Win32Exception (0x80004005): Invalid window handle

   at System.Drawing.Icon.Initialize(Int32 width, Int32 height)

   at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)"              

This is similar with the following, but I am posting it in Windows 7 Update forum.

https://social.msdn.microsoft.com/Forums/en-US/b7cdcdc6-522f-4ea3-9764-cbaa9715d595/kb4537820-causes-systemcomponentmodelwin32exception-in-net-framework-systemdrawingicon-for?forum=clr


 

Question Info


Last updated March 31, 2020 Views 315 Applies to: