使用 DesignTimeVisibleAttribute 在 Toolbox 中停止我的用户控件初始化 [英] Stop my user controls initialization in Toolbox by using DesignTimeVisibleAttribute

查看:26
本文介绍了使用 DesignTimeVisibleAttribute 在 Toolbox 中停止我的用户控件初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 300 多个用户控件来构建我的企业应用程序,每次我在 Visual Studio 中打开应用程序并选择一个表单时,需要 3-5 分钟才能将控件加载到工具箱中,特别是如果工具箱显示它需要更多时间.

I'm using more than 300 user controls for building my enterprise application, every time I'm opening the application in visual studio and selecting one form it's taking 3-5 minutes to load the controls in the Toolbox, especially if the toolbox is showing it's taking more time.

谁可以在我的控件中使用 DesignTimeVisibleAttribute 来停止在工具箱中加载它们?

Who I can use DesignTimeVisibleAttribute in my controls to stop loading them in toolbox?

推荐答案

一般来说,当你开始注意到 Toolbox 需要很长时间来初始化时,你会想看看工具箱存储私有的目录程序集的副本.该目录具有获取在应该清除时未清除的副本的诀窍.不确定是什么原因造成的,设计师崩溃可能是麻烦的根源.它会随着时间的推移而累积,从而大大减慢工具箱的初始化速度.

In general, when you start noticing that the Toolbox takes a long time to initialize, you'll want to take a look at the directory where the toolbox stores private copies of assemblies. That directory has a knack for acquiring copies that don't get cleaned-up when they should. Not exactly sure what causes that, a designer crash is a likely source of trouble. It can build up over time, drastically slowing down the toolbox initialization.

目录名是

   C:\Users\yourname\AppData\Local\Microsoft\VisualStudio\11.0\ProjectAssemblies

其中yourname"是您的用户名,11.0 应与 Visual Studio 版本号匹配.VS2008 = 9.0,VS2010 = 10.0,VS2012 = 11.0,VS2013 = 12.0

Where "yourname" is your user name and 11.0 should match the Visual Studio version number. VS2008 = 9.0, VS2010 = 10.0, VS2012 = 11.0, VS2013 = 12.0

看看你在那里看到的目录,它们有难以形容的名字,很有可能你会遇到不应该再存在的东西.只需删除垃圾目录.然后右键单击工具箱并点击重置",您就会将其恢复干净且快速.

Have a look inside the directories you see there, they have unspeakable names, good odds that you'll run into stuff that should not be there anymore. Just delete the junk directories. Then right-click the toolbox and hit Reset, you'll have it back clean and fast.

这篇关于使用 DesignTimeVisibleAttribute 在 Toolbox 中停止我的用户控件初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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