新的开始

不以物喜,不以己悲

导航

Leadtools控件变组件问题的解决方法

  Visual Studio.Net 2010正式推出已经有一段时间了,用着感觉的确比2008好,特别是Ctrl+滚轮这个代码缩放功能,更是像我这样的视力不佳者的福音。

  不过比较郁闷的是,Leadtools迟迟没有推出17的正式版,貌似还在研究如何使SilverLight的图像处理像Winform一样。所以我们不得不在VS2010中继续使用Leadtools v16.5。

  不过前两天在VS2010的Winform项目中添加Leadtools控件时出现了一个问题,添加进去的控件竟然变成了类似BackgroundWorker一样的组件,也就是不显示在窗体上了!我又打开了之前用VS2008做的项目,发现也是一样的。莫非是Leadtools在VS之前安装所以出现这样的问题?我把Leadtools卸了重装,问题依然。

  没办法,还是上eadtools官网论坛找技术支持求助吧。发好贴,等了一天半,得到回复如下:

 

  Try adding Leadtools.WinForms.Design.dll to your list of references before adding the controls onto the form. This dll is specifically for use with Visual Studio, and does not need to be deployed with the application itself. This dlls provides additional information to Visual Studio for the Designer to function as expected.

 

  也就是在添加控件之前,先添加Leadtools.WinForms.Design.dll的引用。看到回复,赶紧试了下,果然OK!

  除了这个控件变组件的问题之外,在VS2010的项目中使用Leadtools v16.5还会出现一个出现启动错误,以下是错误信息及官网公布的解决方法:

 

When building a .NET 4.0 application using our .NET 2.0 assemblies, you will get a runtime error saying:

System.IO.FileLoadException was unhandled
Message=Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.


To resolve this issue, you will need to open the app.config file in the project and modify the startup element.  You will need to add the useLegacyV2RuntimeActivationPolicy="true" attribute as shown in the screenshot.

 

posted on 2010-06-26 15:57  新的开始  阅读(1163)  评论(0编辑  收藏  举报