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
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 ...
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.
x:Key="ViewModel"
maybe there is a glitchlocal:
does VS show you HistoryViewModel
? Class
is public
Before adding the name space to your .xaml file, please make sure you are not having any compilation errors due to existing code.
Once all the compilation checks are OK, then rebuild your solution and try adding the required namespace to use its class or properties.
In addition to the "does not exist in the namespace" message, I was also getting a message from the designer that it could not display the window for x64 and ARM targets.
I have just found that switching the build to x86 mode, doing a rebuild solution, then switching back to x64 mode and then rebuilding again fixes [both] problems.
Simply rebuilding the x64 solution did nothing.
I had the similar issue. In my case, I had to do the following
<local:HistoryViewModel x:Key="ViewModel"/>
)HistoryViewModel
class )The above method worked for me.
Every time it happend to me i just restarted visual studio, re-built the solution and it worked just fine.. can't say why