Foxtable(狐表)用户栏目专家坐堂 → 升级.net 4.0后第三方控件关闭时报错


  共有1947人关注过本帖树形打印复制链接

主题:升级.net 4.0后第三方控件关闭时报错

帅哥哟,离线,有人找我吗?
grvictor
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:59 积分:1209 威望:0 精华:0 注册:2013/11/21 7:38:00
升级.net 4.0后第三方控件关闭时报错  发帖心情 Post By:2019/6/12 11:50:00 [只看该作者]

我在项目中引用了 winhtmledit 控件,之前可以正常使用,升级4.0后,关闭时报错,错误代码如下:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NotSupportedException: Collection is read only.
   at System.Windows.Forms.ToolStripContainer.ToolStripContainerTypedControlCollection.Remove(Control value)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0, Control A_1)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0, Control A_1)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0, Control A_1)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0, Control A_1)
   at Foxtable.o_0__0_o.o0___oO0(ControlCollection A_0)
   at Foxtable.WinForm.Form.o_o_0__0(Object A_0, EventArgs A_1)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnParentChanged(EventArgs e)
   at System.Windows.Forms.ContainerControl.OnParentChanged(EventArgs e)
   at System.Windows.Forms.Control.AssignParent(Control value)
   at System.Windows.Forms.Control.ControlCollection.Remove(Control value)
   at System.Windows.Forms.Form.ControlCollection.Remove(Control value)
   at System.Windows.Forms.Control.ControlCollection.Clear()
   at Foxtable.WinForm.Form.O O0O  o(Object A_0, FormClosedEventArgs A_1)
   at System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e)
   at System.Windows.Forms.Form.CheckCloseDialog(Boolean closingOnly)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Foxtable
    Assembly Version: 2019.6.13.1
    Win32 Version: 2019.06.13.1
    CodeBase: file:///C:/foxtable/Development/foxtable.exe
----------------------------------------
Foxtable.Lib
    Assembly Version: 2019.6.12.1
    Win32 Version: 2019.06.12.1
    CodeBase: file:///C:/foxtable/Development/Foxtable.Lib.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
C1.Win.C1Ribbon.4
    Assembly Version: 4.0.20191.359
    Win32 Version: 4.0.20191.359
    CodeBase: file:///C:/foxtable/Development/C1.Win.C1Ribbon.4.DLL
----------------------------------------
Interop.JinDI_SmsComLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/foxtable/Development/Interop.JinDI_SmsComLib.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3260.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
C1.Win.C1Command.4
    Assembly Version: 4.0.20191.359
    Win32 Version: 4.0.20191.359
    CodeBase: file:///C:/foxtable/Development/C1.Win.C1Command.4.DLL
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
C1.Win.4
    Assembly Version: 4.0.20191.359
    Win32 Version: 4.0.20191.359
    CodeBase: file:///C:/foxtable/Development/C1.Win.4.DLL
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
C1.Win.C1FlexGrid.4
    Assembly Version: 4.0.20191.359
    Win32 Version: 4.0.20191.359
    CodeBase: file:///C:/foxtable/Development/C1.Win.C1FlexGrid.4.DLL
----------------------------------------
Foxtable.Blank
    Assembly Version: 0.0.0.0
    Win32 Version: 2019.06.13.1
    CodeBase: file:///C:/foxtable/Development/foxtable.exe
----------------------------------------
Interop.MSScriptControl
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/foxtable/Development/Interop.MSScriptControl.DLL
----------------------------------------
C1.Win.C1Input.4
    Assembly Version: 4.0.20191.359
    Win32 Version: 4.0.20191.359
    CodeBase: file:///C:/foxtable/Development/C1.Win.C1Input.4.DLL
----------------------------------------
Foxtable.Ribbon
    Assembly Version: 0.0.0.0
    Win32 Version: 2019.06.13.1
    CodeBase: file:///C:/foxtable/Development/foxtable.exe
----------------------------------------
System.Web
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3282.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
Foxtable.Blank
    Assembly Version: 0.0.0.0
    Win32 Version: 2019.06.13.1
    CodeBase: file:///C:/foxtable/Development/foxtable.exe
----------------------------------------
Office2007Renderer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/foxtable/Development/Office2007Renderer.DLL
----------------------------------------
Neodynamic.WinControls.BarcodeProfessional
    Assembly Version: 10.0.2000.0
    Win32 Version: 10.0.2018.508
    CodeBase: file:///C:/foxtable/Development/Neodynamic.WinControls.BarcodeProfessional.DLL
----------------------------------------
fjrqntvc
    Assembly Version: 0.0.0.0
    Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
qeat3rku
    Assembly Version: 0.0.0.0
    Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.Design.dll
----------------------------------------
管理项目1.Form.93dbfe97
    Assembly Version: 0.0.0.0
    Win32 Version: 2019.06.13.1
    CodeBase: file:///C:/foxtable/Development/foxtable.exe
----------------------------------------
C1.Win.C1Chart.4
    Assembly Version: 4.0.20191.359
    Win32 Version: 4.0.20191.359
    CodeBase: file:///C:/foxtable/Development/C1.Win.C1Chart.4.DLL
----------------------------------------
WinHtmlEditor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/foxtable/Development/WinHtmlEditor.DLL
----------------------------------------
NetSpell.SpellChecker
    Assembly Version: 2.1.7.39341
    Win32 Version: 2.1.7.39341
    CodeBase: file:///C:/foxtable/Development/NetSpell.SpellChecker.DLL
----------------------------------------
Microsoft.mshtml
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.0.3300.0
    CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
Microsoft.CSharp
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
----------------------------------------
System.Dynamic
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
[此贴子已经被作者于2019/6/12 12:42:01编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/6/12 12:36:00 [只看该作者]

提示说【Collection is read only】,集合只读不能移除remove。

 

具体做个实例发上来测试。


 回到顶部
帅哥哟,离线,有人找我吗?
grvictor
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:59 积分:1209 威望:0 精华:0 注册:2013/11/21 7:38:00
回复:(有点甜)提示说【Collection is read only】,...  发帖心情 Post By:2019/6/12 12:43:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.zip


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/6/12 12:47:00 [只看该作者]

 

其中 Sonic.HtmlEditor.dll 你需要用 .net 4.0 的版本,不能用旧版本

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
grvictor
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:59 积分:1209 威望:0 精华:0 注册:2013/11/21 7:38:00
回复:(有点甜) 其中 Sonic.HtmlEditor.dll ...  发帖心情 Post By:2019/6/12 13:03:00 [只看该作者]

还是不行,不是这个问题,这个好像是 Foxtable 的那个winform类继承了windows.form类,在关闭Form的时候会主动移除ToolStripContainer里面的内容,这块报错了。

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/6/12 14:58:00 [只看该作者]

以下是引用grvictor在2019/6/12 13:03:00的发言:
还是不行,不是这个问题,这个好像是 Foxtable 的那个winform类继承了windows.form类,在关闭Form的时候会主动移除ToolStripContainer里面的内容,这块报错了。

 

你给的项目无法直接测试,请上传可以正确打开测试的项目。

 


 回到顶部
帅哥哟,离线,有人找我吗?
grvictor
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:59 积分:1209 威望:0 精华:0 注册:2013/11/21 7:38:00
  发帖心情 Post By:2019/6/12 15:17:00 [只看该作者]

就是文件夹里那个DLL,引用之后在A表的窗口1中。因为那个引用DLL不发布的话就在C盘FOXTABLE那个文件夹下面。
我刚才又测试了下,还是不行。我想到了一个折中的办法,就是在窗口beforecloseform事件中,删掉这个控件。请问一下我在这个事件中怎么获取到控件,因为好像没有写窗口全局代码的地方.....

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/6/12 15:25:00 [只看该作者]

以下是引用grvictor在2019/6/12 15:17:00的发言:
就是文件夹里那个DLL,引用之后在A表的窗口1中。因为那个引用DLL不发布的话就在C盘FOXTABLE那个文件夹下面。
我刚才又测试了下,还是不行。我想到了一个折中的办法,就是在窗口beforecloseform事件中,删掉这个控件。请问一下我在这个事件中怎么获取到控件,因为好像没有写窗口全局代码的地方.....

 

只有一个dll,会提示报错,请把相关的对应的dll都发上来。


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2019/6/12 16:10:00 [只看该作者]

可以在窗口的Beforeclose事件中用自己的代码移除第三方控件。

 回到顶部