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.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫