Click here to Skip to main content
15,895,922 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

whenever I build a visual studio 2008 c# project on Windows 7, an attempt to run the application on Windows xp would result in an error. However, if I build the same project on windows xp, it would run smoothly.

This is the error I'm getting.

System.ArgumentException: Parameter is not valid.<br />
   at System.Drawing.Image.get_FrameDimensionsList()<br />
   at System.Drawing.ImageAnimator.CanAnimate(Image image)<br />
   at System.Drawing.ImageAnimator.ImageInfo..ctor(Image image)<br />
   at System.Drawing.ImageAnimator.Animate(Image image, EventHandler onFrameChangedHandler)<br />
   at System.Windows.Forms.PictureBox.Animate(Boolean animate)<br />
   at System.Windows.Forms.PictureBox.Animate()<br />
   at System.Windows.Forms.PictureBox.InstallNewImage(Image value, ImageInstallationType installationType)<br />
   at System.Windows.Forms.PictureBox.set_Image(Image value)


Anyone have an idea of what this issue might be?

Thank you
Posted
Updated 31-Jan-11 22:17pm
v3
Comments
Umair Feroze 1-Feb-11 4:15am    
It will be easy to identify the issue if you provide the erroneous code here.
deadwood88 1-Feb-11 4:19am    
Well the thing is that the code compiles with no error. When I build it on XP and run it on XP it works smoothly. And when I build the solution on Windows 7 and run it on windows 7 it works fine also. However if I build it on windows 7 and run it on windows xp, the above mentioned error occurs.
deadwood88 1-Feb-11 4:24am    
here is the line at which the error is raised

protected override void SetupUI() {
picLogo.Image = Resources.cards;
}

Most likely reason: Go to progect(s) properties, check up target assembly and target CPU (better be "any cpu"). These parameters for all assemblies involved should compile and run on one machine and then compatible with whatever installed on the other one. Do you know CPU architectures and installed versions of .NET Framework? You should know.

If this does not help, dump exception in full (output exception stack, all inner exceptions, recursively). Look at the exception stack and provide codes responsible for exception. Post text of exception dump and the code. If you don't know how to dump exception, asking questions would be useless, you need to learn it to report problems in comprehensible way.

—SA
 
Share this answer
 
Comments
deadwood88 1-Feb-11 5:19am    
These parameters are correct and are compatible with the machine im trying to run my application on. Below is the exception i was able to catch, if it's not comprehensible enough thanks for trying.

System.ArgumentException: Parameter is not valid.

at System.Drawing.Image.get_FrameDimensionsList()

at System.Drawing.ImageAnimator.CanAnimate(Image image)

at System.Drawing.ImageAnimator.ImageInfo..ctor(Image image)

at System.Drawing.ImageAnimator.Animate(Image image, EventHandler onFrameChangedHandler)

at System.Windows.Forms.PictureBox.Animate(Boolean animate)

at System.Windows.Forms.PictureBox.Animate()

at System.Windows.Forms.PictureBox.InstallNewImage(Image value, ImageInstallationType installationType)

at System.Windows.Forms.PictureBox.set_Image(Image value)
Sergey Alexandrovich Kryukov 1-Feb-11 19:40pm    
Hm. Interesting... It does not look complete though. How did you obtain this dump? Normally is should show you file and line number where the exception is thrown/processed. I would also look at that lines. Did you catch exception programmatically and dumped Exception object (using what code?)? Was it Debug build?
--SA
deadwood88 2-Feb-11 2:09am    
It didnt show the file and where the exception was thrown/processed. I didnt post it cause it didnt think they were of any relavence. Here is the line at which the error is raised

protected override void SetupUI() {

picLogo.Image = Resources.cards; }

It was catched programmatically using c#. And yes it was debug build
Problem is resolved. I loaded the image using a memory stream. However it's still not clear why this problem was only raised when the solution was built on windows 7.

Anyone have a clue?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900