“System.Int32”类型的对象无法转换为“System.Int16”类型。 0 0 [英] Object of type 'System.Int32' cannot be converted to type 'System.Int16'. 0 0

查看:477
本文介绍了“System.Int32”类型的对象无法转换为“System.Int16”类型。 0 0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一个错误的Visual Studio 2012问题(类型为''System.Int32''的对象无法转换为类型''System.Int16'') />
我的类lib在VS 2010中使用框架4.0创建,它在VS 2010中运行良好,但是当我安装Vs 2012 framWork 4.5时,我有一条错误消息(类型为''System.Int32'的对象)当我打开表单设计时,'无法转换为''System.Int16'')。

谢谢

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

推荐答案

按照提供的细节,我的猜测是,在不同框架中编写的应用程序试图通过一些不同的框架进行调整,而不允许它进行适当的转换。



不确定它是否真的有帮助,但只需进行快速测试并按照以下步骤查看它是否能解决您的问题:



1)转到菜单,项目 - > < project name =>属性

2)转到应用程序选项卡

3)查找目标框架

4)将其设置为Framework 4.0(预计安装VS2012后为4.5)

5)将显示一个弹出窗口,提示您重新启动项目,允许它。





希望它有所帮助!
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!


这篇关于“System.Int32”类型的对象无法转换为“System.Int16”类型。 0 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆