Click here to Skip to main content
15,885,182 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Hi all
I have a problem with Visual studio 2012 with an error (Object of type 'System.Int32' cannot be converted to type 'System.Int16')
My class lib Button was create in VS 2010 with framework 4.0, It work fine in VS 2010, but when I installed Vs 2012 framWork 4.5, I have an error message (Object of type 'System.Int32' cannot be converted to type 'System.Int16') when I open the Form design.
thank you
Posted
Comments
Mohammed Hameed 15-May-13 9:38am    
It should not have any impact when you upgrade to .NET 4.5.
Anyhow, can you send the complete stack trace and also the piece of code on which this exception occurs.
lewax00 15-May-13 9:57am    
You asked this yesterday, and I'll tell you the same thing I told you then: we can't help you without seeing the line causing the error. You can re-ask the question all you want, but without the relevant details, no one can help you.
Member 2497977 15-May-13 10:25am    
HiI didn't upgrade my application from VS 2010 to VS 2012, only I installed VS 2012 in my computer for the new project. when I opened my old application in VS 2010 , I have this error.
thanks
Member 2497977 15-May-13 10:28am    
sorry, I like to load error image but i don't known. how can I load my error image in forum?
Sergey Alexandrovich Kryukov 15-May-13 10:42am    
Don't do it. Copy relevant text and paste it. Text only, please.
—SA

1 solution

As per the provided details, my guess is that the application that is written in a different framework is trying to be adjustable with some different framework WITHOUT allowing it to do a proper conversion.

Not sure if it really helps, but just give a quick test and follow the below steps and see if it resolves your issue:

1) Goto menu, Project-> <project name=""> Properties
2) Goto "Application" Tab
3) Find "Target Framework"
4) Set it to Framework 4.0 (it is expected to be 4.5, after your installation of VS2012)
5) A popup will be shown which will prompt you about a restart of the Project, allow it.


Hope it helps!
 
Share this answer
 
v2
Comments
Member 2497977 15-May-13 17:06pm    
Hi
Our application in the VSS, I don't modify the framwork, in the project property is FrameWork 4.0. the project is readonly.I don't use framework 4.5 in VS 2010.
I think framework 4.5 is not compatible with framework 4.0. When I installed framework 4.5, it copy in the same directory framework 4.0 (C:\Windows\Microsoft.NET\Framework64\v4.0.30319)
I modified to framework 4.0 in VS 2010, it doesn't work too.
1/when I removed framework 4.5 then the application is work fine but the VS 2012 has an error message (the operation can not completed). I cannot open VS2012.
2/when I installed Framework 4.5 then the VS 2012 is work fine, but my application has ann error.
thank you for your help
Shahan Ayyub 18-May-13 6:54am    
can you send the snap shot of the error screen ?

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