在 XAML 中引用另一个项目:未定义的 CLR 命名空间 [英] Referring to another project in XAML: Undefined CLR namespace

查看:34
本文介绍了在 XAML 中引用另一个项目:未定义的 CLR 命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自项目MarkdownEditorTest"我试图引用另一个名为MarkdownEditor"的项目中的控件.但我得到了未定义的 CLR 命名空间";错误如下图所示.

From the project "MarkdownEditorTest" I am trying to refer to controls from another project called "MarkdownEditor" but am getting the "Undefined CLR namespace" error as seen in the image below.

引用那个项目的方式不是类似于下面这样吗?

Isn't the way to refer to that project something like below?

 xmlns:me="clr-namespace:MarkdownEditor"

推荐答案

请注意,每个项目(C#、VB 等)都会创建自己的程序集.

Note that each project (C#, VB, etc.) creates its own assembly.

如果在另一个程序集中,则需要指定程序集名称:

If it's in another assembly, you need to specify the assembly name:

xmlns:me="clr-namespace:MarkdownEditor;assembly=MarkdownEditor"

请注意,通常解​​决方案中的每个项目都会创建一个不同的程序集.请注意,项目名称可以与程序集名称不同.您可以在项目的属性(在应用程序选项卡中)中看到程序集名称.

Note that generally each project in a solution creates a distinct assembly. And note that a project's name can be different than the assembly name. You can see the assembly name in the project's properties (in the application tab).

另外,请注意项目名称可能与程序集名称不同.您可以在项目的属性(在应用程序选项卡中)中看到程序集名称.

Also, be aware that a project's name can be different than the assembly name. You can see the assembly name in the project's properties (in the application tab).

这篇关于在 XAML 中引用另一个项目:未定义的 CLR 命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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