The 'clr-namespace' URI refers to a namespace that is not included in the assembly

后端 未结 10 1921
醉梦人生
醉梦人生 2020-12-02 18:32

I\'m trying to include in my XAML some classes which convert values. However, I\'m getting the following error when I compile:

Undefined CLR namespac

相关标签:
10条回答
  • 2020-12-02 18:35

    rebuild the solution and the error will go away.

    0 讨论(0)
  • 2020-12-02 18:41

    I figured out what was wrong. Although visual studio showed this as the first error, there were indeed other errors with my coding which prevented the converters from being assembled. Thus, when VS went to find the assembly, it was not there.

    0 讨论(0)
  • 2020-12-02 18:41

    some problem with vs2008 designer

    do this:

    1. close the designer
    2. rebuild-all (Alt+B+R) the solution

    now there wont be any errors.

    0 讨论(0)
  • 2020-12-02 18:45

    I just solved this by changing the target from x64 to x86. Apparently Visual Studio is 32bit process and it's unable to load 64bit assemblies, and if your assembly is targeting x64 platform and you adding some custom control visual studio is unable to load it and throws this message.

    0 讨论(0)
  • 2020-12-02 18:48

    I was able to reproduce your issue:

    I created a simple WF in .NET Framework 4.0. Renamed the xaml file. As part of renaming the xaml file you have to manually rename the workflow runtime name when calling the Invoke on the WorkflowInvoker object. I build the project. I got the error "The 'clr-namespace' URI refers to a namespace 'System' that is not included in the assembly."

    How I fixed it:

    I open the project property page. For some reason, the target framework was switch from .NET framework 4.0 to 4.0 client version. So, I selected .NET 4.0 and rebuilt the project. The error is not there anymore.

    0 讨论(0)
  • 2020-12-02 18:54

    If you reference to an external project, you must specify the assembly as it appears in your project's references:

    xmlns:mdls="clr-namespace:MyProject.Models;assembly=MyProject.Models"
    
    0 讨论(0)
提交回复
热议问题