如何使用可扩展性 dll 来提供设计器支持
我编写了一个 UITypeEditor,当编辑器与使用它的类型位于同一程序集(或引用的程序集之一)时,它就可以工作。然后我可以使用类似的东西:
[Editor(typeof(MyUIEditor), typeof(UITypeEditor))]
但是,我想将其移动到一个单独的程序集,该程序集不会被使用它的类型的程序集引用,因为我不想分发单独的代码对于 VS 设计师来说。我知道这是可以做到的,但无法弄清楚如何设置编辑器/在哪里放置可扩展性程序集以使其正常工作。我已经尝试过:
[Editor("MyProject.Extensibility.MyUIEditor, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e54367fa007b34d2", typeof(UITypeEditor))]
并将可扩展性程序集复制到主项目的 bin\debug 文件夹中。没有喜悦。
这是怎么做到的?
I've written a UITypeEditor and it works when the editor lives in the same assembly (or one of the referenced assemblies) as the types using it. Then I can use something like:
[Editor(typeof(MyUIEditor), typeof(UITypeEditor))]
However, I'd like to move this to a separate assembly, one that is not referenced by the assemblies with types that use it, because I don't want to have to distribute the code that is solely to for the VS designer. I know this can be done, but can't figure out how to setup the editor/where to put the extensibility assembly to get it to work. I've tried this:
[Editor("MyProject.Extensibility.MyUIEditor, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e54367fa007b34d2", typeof(UITypeEditor))]
And copied the extensibility assembly into the bin\debug folder with the main project. No joy.
How is this done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我问了一个更有针对性的不同问题并得到了答案。请参阅与在另一个程序集中引用 UITypeEditor 相关的此问题。诀窍是设置一个注册表项(或放入 GAC 中)。
I asked a different question that was a bit more focused and got the answer. See this question related to referencing a UITypeEditor in another assembly. The trick is to set a registry key (or put in GAC).