Program running on Windows 7 will hit exception after installed Microsoft Windows Security Update (KB4537820). “Message Exception has been thrown by t

S

Siong YuenCheah

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.

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



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.

KB4537820 causes System.ComponentModel.Win32Exception in .Net framework System.Drawing.Icon for WinForms apps on Windows 7 SP1

Continue reading...
 
Back
Top Bottom