即使我引用它,Visual Studio 也不会将我的组件(来自 DLL)添加到工具箱中 [英] Visual Studio do not add my component (from a DLL) to the toolbox even if I reference it
问题描述
如标题所述,我在 Visual Studio 项目中复制了我的 DLL,将其设置为内容"和始终复制".添加了对此 DLL 的引用并将其设置为本地复制".
As stated in the title, I copied my DLL in Visual Studio project, set it to "content" and "copy always". Added a reference to this DLL and set it to "copy locally".
我成功地通过代码将我的组件实例化为一个表单,但它没有出现在工具箱中,真的很无聊.
I successfully managed to instance my component to a form through code but it doesn't appear in the toolbox, really boring.
我该如何解决这个问题?
How can I solve this issue?
如果我将 DLL 项目直接链接到该项目,它可以工作,但现在我将 DLL 视为外部",因此它不是 DLL 项目的同一解决方案的一部分.
If I link directly the DLL project to this project it works, but now I'm treating the DLL as "external" so it's not part of the same solution of the DLL project.
推荐答案
我发现的方法是:
- 添加 dll,引用它
- 编译项目
- 保存解决方案并重新启动 Visual Studio
然后控件出现在工具箱中(并不总是有效,我认为这是一种视觉工作室错误)
And then controls show up in toolbox (not always working, I think is a sort of visual studio bug)
这篇关于即使我引用它,Visual Studio 也不会将我的组件(来自 DLL)添加到工具箱中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!