TargetInvocationException
-
Its so bad i cant find any solution on this exception. The program is running well on the windows 7 machine, but its not working on windows XP(ugh.. they cant move on their old machine). I am getting this exception Exception Info: System.Reflection.TargetInvocationException base on the stack the exception started at Properties.Resources.get_mainIcon() now looking at the IL, the cause of the exception is setting the form icon
form.Icon = Properties.Resources.mainIcon;
can anybody here shade me some light. any advice will be appreciated. Thank you.
-
Its so bad i cant find any solution on this exception. The program is running well on the windows 7 machine, but its not working on windows XP(ugh.. they cant move on their old machine). I am getting this exception Exception Info: System.Reflection.TargetInvocationException base on the stack the exception started at Properties.Resources.get_mainIcon() now looking at the IL, the cause of the exception is setting the form icon
form.Icon = Properties.Resources.mainIcon;
can anybody here shade me some light. any advice will be appreciated. Thank you.
Is there an InnerException being raised?
-
Its so bad i cant find any solution on this exception. The program is running well on the windows 7 machine, but its not working on windows XP(ugh.. they cant move on their old machine). I am getting this exception Exception Info: System.Reflection.TargetInvocationException base on the stack the exception started at Properties.Resources.get_mainIcon() now looking at the IL, the cause of the exception is setting the form icon
form.Icon = Properties.Resources.mainIcon;
can anybody here shade me some light. any advice will be appreciated. Thank you.
-
Is there an InnerException being raised?
Finally, I made it worked. The problem is on the icon itself, it doesn't support some resolution. The solution is, I just create an icon that has 16x16, 32x32, 48x48 pixel resolutions. BTW thank you for the reply.
-
Thanks for the reply, here is the actual stack trace.
Exception Info: System.Reflection.TargetInvocationException
Stack:
at System.RuntimeMethodHandle._SerializationInvoke(System.IRuntimeMethodInfo, System.Object, System.SignatureStruct ByRef, System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(System.Object, System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(System.Runtime.Serialization.ObjectHolder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(System.Runtime.Remoting.Messaging.HeaderHandler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream, System.Runtime.Remoting.Messaging.HeaderHandler, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)
at System.Resources.ResourceReader.DeserializeObject(Int32)
at System.Resources.ResourceReader._LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
at System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
at System.Resources.ResourceReader.LoadObject(Int32, System.Resources.ResourceTypeCode ByRef)
at System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean, Boolean)
at System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean)
at System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo, Boolean)
at System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo)
at POS.Properties.Resources.get_POS_RED()
at POS.Extensions.AssignIcon(System.Windows.Forms.Form)
at POS.Program.Main()actually I already fixed the problem, see my reply above on Pete
-
Finally, I made it worked. The problem is on the icon itself, it doesn't support some resolution. The solution is, I just create an icon that has 16x16, 32x32, 48x48 pixel resolutions. BTW thank you for the reply.
That can help me out! Had this problem in the past on a Windows CE Device
In Word you can only store 2 bytes. That is why I use Writer.