tag does not exist in XML namespace

后端 未结 7 1236
闹比i
闹比i 2021-01-03 22:34

This error seems to be posted all over the place but each one seems to have its own solution, none of which solved my problem.

I am getting an error for a Resource D

相关标签:
7条回答
  • 2021-01-03 22:44

    Looks like it was mostly a user error. But this could happen to others. When I copied the xmlns:moduleviewmodel definition from its original file I had to add the assembly= portion on my own. Like I said I both did it myself as well as use the autocomplete the follows from typing 'xmlns:moduleviewmodel=' . Right before we found the error we tried the autocomplete again because we found that there was one of the 7 namespaces not generating the error. It was then that I noticed that there was a letter in assembly path that was not capitalized that should be. The weird thing is the autocomplete actually inserts this error on its own. While we were compiling that I noticed the erroneous letter. The weirder thing is that after I fixed all the paths manually we tried the autocomplete again and it spelled it correctly.

    I have no idea the cause of the errored autocomplete but with the fixed letter it compiles just fine.

    Now I just wonder if anyone will believe the autocomplete was changing up on me!

    0 讨论(0)
  • 2021-01-03 22:48

    I have had a totally different reason for this error:

    I was trying to use a class from assembly A, so I

    1) added reference to this assembly to my project,

    2) added reference to assembly B, which is used by assembly A, to my project,

    3) added to my XAML

     xmlns:assemblyA="clr-namespace:A;assembly=A"
    

    3) added to my code

    using A;
    

    This didn't work, I have got this "Tag doesn't exist" error.

    What did help, was adding

    using B;
    

    in my code, though I do not use directly anything from assembly B.

    0 讨论(0)
  • 2021-01-03 22:49

    If you have user control in same assembly as WPF form make sure you get rid of assembly part while importing namespace

    Wrong Import: xmlns:usercontrol="clr-namespace:CCFARKS.UserControls;assembly=CCFARKS"

    Corret: xmlns:usercontrol="clr-namespace:CCFARKS.UserControls"

    0 讨论(0)
  • 2021-01-03 22:52

    This may not be the solution for your problem, but I see the error you are asking about quite often, and the issue is generally caused by a problem loading the assembly.

    If you check your assemble, and it has a yellow triangle attached to it, then it is likely not compatible with your current project setup, due do different versions of .NET, or something of the sort.

    This will usually fail silently, or only cause a warning; when you try to reference the assemble in your XAML you will get an error like you described.

    0 讨论(0)
  • 2021-01-03 22:55

    According to this article, you just do as follow:

    FROM:

    xmlns:ZZZ="clr-namespace:YYY;assembly=YYY"

    TO:

    xmlns:ZZZ="clr-namespace:YYY;assembly="

    leave empty value for assembly=

    This is the solution that works for me.

    0 讨论(0)
  • 2021-01-03 22:57

    Check Warnings in error list, in my case there where messages about unresolved .Net 4.5.1 references, while my project target framework was 4.5

    0 讨论(0)
提交回复
热议问题