the name <…> does not exist in the namespace clr-namespace <…>

前端 未结 25 1211
名媛妹妹
名媛妹妹 2020-11-28 04:59

I have a small WPF application which used to compile just fine but is not anymore. I can\'t really say at which point it stopped building. It just worked fine one day, and t

25条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 05:31

    Ran into this issue today with Visual Studio 2017 Community Edition. Tried all the suggestions here (reset VS 2017, changed from x64 to x32 and back again etc etc) and from other sources to no avail. Intellisense knows everything is there but I was getting the same error everytime.

    Anyway, my fix turned out to be very simple ... aren't they always when you have spent a couple of hours on the problem!

    Basically, I did the following ...

    1. Remove offending code from xaml file (just 3 lines in my case)
    2. Build project so you get a successful build
    3. At this point the layout magically appeared in the designer window which was a good sign!
    4. Reinserted the code I removed in point 1. including the xmlns: entry
    5. At this point you shouldn't get any blue squiggles ... hopefully
    6. Build the project again

    It's seem that by getting a successful build, it must reset 'something' within VS and/or the assembly. Once you have a successful build try inserting your code again.

提交回复
热议问题