Referring to another project in XAML: Undefined CLR namespace
Asked Answered
S

3

40

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"

Sedgewake answered 19/11, 2010 at 12:42 Comment(0)
H
66

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).

Hyman answered 19/11, 2010 at 12:44 Comment(0)
D
7

I know that this may be a silly question, but have you included a reference to the other project in your visual studio project ?

Dorkas answered 19/11, 2010 at 12:55 Comment(2)
I haven't, and I was getting the same error. Thanks for saying that.Rising
This might help someone at-least a beginner. So this is not a silly question :)Adah
A
0

I had the Same problem that occurred though I have added assembly. It's due to .net framework mismatch. So make sure your framework version of the assembly is equal or lower to the current project. I hope this answer will help someone else.

Adah answered 6/12, 2019 at 4:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.