VS Shell 中的 XAML:加载没有引用的程序集

发布于 2024-08-22 06:40:22 字数 367 浏览 4 评论 0原文

我目前正在尝试自定义 Visual Studio 独立外壳,以便它可以打开 XAML 文件及其设计器,而无需解决方案或项目。因此,为了让设计器加载,Visual Studio 需要识别 XAML 文件中的每个 xaml 标记,否则它不会加载并告诉我该文档包含错误。

我目前正在尝试在没有参考的情况下从 Telerik 的控制集 (RadControls) 手动加载程序集,因为我需要在没有解决方案/项目的情况下使用设计器。

是否可以在没有 VS 项目引用的情况下从像 Telerik 这样的“自定义”.dll 手动加载 XAML 中的程序集,以便 Visual Studio 在设计时识别程序集中的自定义控件(以便使用 WPF 设计器)?

谢谢!

萨蒂克斯

I'm currently trying to customize a Visual Studio Isolated Shell so it opens a XAML file and its designer without a solution or a project. Therefore, for the designer to load, Visual Studio need to recognize every xaml tag in the XAML file or it won't load telling me that the document contains errors.

I'm currently trying to manually load an assembly from Telerik's control set (RadControls) without a reference since I need to use the designer without a solution/project.

Is it possible to manually load an assembly in XAML from a "custom" .dll like Telerik's without a VS project reference so the custom controls from the assembly are recognized by Visual Studio at design time (in order to use the WPF designer)?

Thanks!

SatixX

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

错々过的事 2024-08-29 06:40:22

也许您可以读取命名空间引用并尝试解析 GAC 和/或任何其他位置中的程序集(想想 .NET 本身查找程序集的标准路径)。然后尝试用反射加载它们。之后您可以尝试加载 XAML。但是:如果未找到程序集,您应该抛出错误并停止加载 XAML。此外,考虑应用程序域可能很合适,因为您可以再次卸载它。

-sa

maybe you can read the namespace references out and try to resolve the assemblies in GAC and/or any other location (think of standard paths .NET itselfs looks for assemblies). Then try to load them with reflection. Afterwards you then could try to load the XAML. But: if an assembly isn't found, you should throw an error and stop loading the XAML. Also, considering an appdomain might be well suited because you can unload it again.

-sa

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文