问题:将dotnet framework 4.0 切换到2.0时,编译没有问题,在运行时出现如下错误:System.InvalidCastException: 无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”。

解决方法:

注释掉如下代码(此代码为设计器自动生成代码)

//((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
//((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();

【参考文献】点击进入

【Winform】 无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”。的更多相关文章

  1. 无法将类型为“System.Windows.Controls.SelectedItemCollection”的对象强制转换为类型“System.Collections.Generic.IList`1

    在WPF中DataGrid 选择事件中获取SelectedItems 报错如下 无法将类型为“System.Windows.Controls.SelectedItemCollection”的对象强制转 ...

  2. WPF System.InvalidCastException: 无法将类型为“System.Windows.Media.Color”的对象强制转换为类型“System.Windows.Media.Brush”。

    场景:添加ComboBox样式,界面卡死,日志异常文件如下: -- ::, | ERROR | System.InvalidCastException: 无法将类型为“System.Windows.M ...

  3. .net4.0切换2.0时,SplitContainer”的对象强制转换为类型

    问 题:将dotnet framework 4.0 切换到2.0时,编译没有问题,在运行时出现如下错误:System.InvalidCastException: 无法将类型为“System.Windo ...

  4. 保存图片控件上的图片到本地 出现错误:无法将类型为“System.Windows.Media.Imaging.BitmapFrameDecode”的对象强制转换为类型“System.Windows.Media.Imaging.BitmapImage”。

    保存图片控件上的图片到本地 出现错误:无法将类型为“System.Windows.Media.Imaging.BitmapFrameDecode”的对象强制转换为类型“System.Windows.M ...

  5. 无法将类型为“System.Decimal”的对象强制转换为类型“System.Char[]”。

    在用微软的SSIS操作ORACLE 数据源的时候碰到以下报错信息: [ADO NET Destination [13455]] 错误: 数据插入期间出现异常,从提供程序返回的消息为:无法将类型为&qu ...

  6. Web Service接口返回泛型的问题(System.InvalidCastException: 无法将类型为“System.Collections.Generic.List`1[System.String]”的对象强制转换为类型“System.String[]”)

    在使用C#写Web Service时遇到了个很奇怪的问题.返回值的类型是泛型(我用的是类似List<string>)的接口,测试时发现总是报什么无法转换为对象的错误,百思不得其解. 后来在 ...

  7. 无法将类型为“System.DBNull”的对象强制转换为类型“System.String”

    在ERP中做业务类单据,有时候会遇到这样的报错. 无法将类型为"System.DBNull"的对象强制转换为类型"System.String"   去数据库中检 ...

  8. C# 无法将类型为“__DynamicallyInvokableAttribute”的对象强制转换为类型...

    错误代码: //遍历方法特性 foreach (MethodInfo m in type.GetMethods()) { foreach(Attribute a in m.GetCustomAttri ...

  9. 如何解决”无法将类型为“System.DateTime”的对象强制转换为类型“System.String”。“

    字段Time在数据库中为datetime类型 dr.GetString(3).ToString() dr.GetString(3).ToString() => dr.GetDateTime(3) ...

随机推荐

  1. oc-11-结构体

    #import <Foundation/Foundation.h> /* 设计一个“学生”类 1)属性 姓名 生日 用结构体作为类的实例变量(生日) 定义结构用来描述 生日 类名: Stu ...

  2. C语言--enum,typedef enum 枚举类型详解

    原文:http://z515256164.blog.163.com/blog/static/32443029201192182854300/ 有改动 C语言详解 - 枚举类型 注:以下全部代码的执行环 ...

  3. 数据库插入某些数据会变成?,或则select无法读出数据库中的某些数据

    如果你想在数据库中插入“uɷ”,这个字符,直接插入 insert into table value (‘uɷ’),是不行的,这样插入的后果是打开数据后会显示为u?.当你面对这个问题的时候是不是第一个想 ...

  4. VirtualBOX 虚拟机安装 OS X 10.9 Mavericks 及 Xcode 5,本人X220亲测

    原文链接:http://bbs.weiphone.com/read-htm-tid-7625465.html 建议电脑要求    Windows 7/8, 32 / 64 bit    CPU Int ...

  5. Apache以及PHP的默认编码问题解决(详解)

    如果你在网上搜索 “apache配置”,搜到的页面大多都会建议你在httpd.conf中加上这么一句:AddDefaultCharset GB2312.对于新手而且是只用GB2312编码的开发人来说, ...

  6. mysql的二级索引

    mysql中每个表都有一个聚簇索引(clustered index ),除此之外的表上的每个非聚簇索引都是二级索引,又叫辅助索引(secondary indexes). 以InnoDB来说,每个Inn ...

  7. Socket的使用

    import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import jav ...

  8. 安卓AlertDialog的使用

    AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setMessage("数 ...

  9. Maven 仓库

    Maven仓库分为本地仓库和远程仓库(中央仓库,私服,其他公共仓库)一张图就可以很清楚的看出结构 本地仓库:本地仓库是在我们当前电脑系统盘的user-administrator-m2-reposito ...

  10. DataTables warning (table id = 'myTable'): Requested unknown parameter '0' from the data source for row 0

    第一种方式:不用在js里设置列Html: <table id="myTable"> <thead> <tr> <th>Title-1 ...