Undefined CLR namespace

前端 未结 10 1144
萌比男神i
萌比男神i 2020-12-18 23:18

I have the following:

\"Error!

The error says The \'clr-namespace\' URI refers to a na

10条回答
  •  情歌与酒
    2020-12-18 23:28

    I've had the same issue, mine was self inflicted due to copying and pasting code from another source into my project and renaming objects as I went without building first.

    So, this means Visual Studio or the compiler do not pick up on incorrect references (eg, in my code I had this:

    MyObect mo = new MyObect();
    

    When I copied the code over, I corrected the spelling of MyObect to MyObject but, Visual Studio has still referencing MyObect and didn't give any warnings about this. And this was code was part of a .XAML file and as such, I was not only getting the error message you were, but also .g.cs errors too. All of them pointing to the incorrect reasons.

    This was also occuring in the ResourceDictionary (within my datatemplate declarations for all my VM binding)

提交回复
热议问题