1
votes

So I designed a program using Visual Studio 2010 on a Win7 box. For the sake of this the program is called Test.exe

When another user, using Win XP tries to open this program, it pops up a Just In Time Debugger window and never runs. I can open the program on my Win7 box and additional Win7 boxes and each time the program opens.

I'm not exactly sure where to begin to figure out why Win XP machines fail to run this program.

Any suggestions?

EDIT

Here is the exception error we got but running the debugger on the XP machine.

System.InvalidOperationException was unhandled Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Exception has been thrown by the target of an invocation. Source=WinApp StackTrace: at WinApp.My.MyProject.MyForms.Create_Instance_[T](T Instance) at WinApp.My.MyProject.MyForms.get_Form1() at WinApp.My.MyApplication.OnCreateMainForm() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at WinApp.My.MyApplication.Main(String[] Args) InnerException: System.Reflection.TargetInvocationException Message=Exception has been thrown by the target of an invocation. Source=mscorlib StackTrace: at System.RuntimeMethodHandle._SerializationInvoke(IRuntimeMethodInfo method, Object target, SignatureStruct& declaringTypeSig, 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) at WinApp.Form1.InitializeComponent() at WinApp.Form1..ctor() InnerException: System.ComponentModel.Win32Exception Message=The parameter is incorrect Source=System.Drawing ErrorCode=-2147467259 NativeErrorCode=87 StackTrace: at System.Drawing.Icon.Initialize(Int32 width, Int32 height) at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context) InnerException:

1
Consider debugging the program to see why it's crashing. - Raymond Chen

1 Answers

2
votes

You'll need to make sure that the Windows XP system has the appropriate version of the .NET Framework installed.

Also, there are many types that will not work on XP within .NET framework 4. For example, if you use the MD5Cng class, you'll see (in the "Platforms" section of the docs) that it's only supported on Vista+, not on XP. Using this class in a program will cause an exception if it's run on XP.


Edit:

From your stack trace, it looks like your Form (WinApp.Form1) is using an Icon (.ico) which is a format that is unsupported by Windows XP. For example, if you use a full color icon, this can raise an exception on XP. Make sure it's a 256 color icon file to work properly on XP.