C#C
C#4y ago
Bin

Wpf won't compile because SomeClass do not exist in SomeNamespace (but it actually exist!) (solved)

I have Wpf app that don't want to compile after adding Window.DataContext tag pointing to viewmodel class.
The compiler error message says The name SomeVMName does not exist in the namespace SomeNamespaceName (error code XDG0008)
but it is very clear that SomeVMName obviously defined in SomeNamespaceName.
Previously it works fine, the compiler can find SomeVMName in the namespace. After some modifications, the compiler can't find SomeVMName anymore so i'm guessing it's the compiler bug or whatnot.

I have tried restarting visual studio, cleaning the solution (and even deleting the bin and obj folder) but the compilation error still persist. What should i do now? I don't want to rewrite the whole project from scratch. This wpf app may be tiny but i do have another wpf app that does have exactly same problem as this one.

My code is in the screenshot.
SomeNamespaceName is WpfApp3.ViewModels
SomeVMName is WpfApp3.ViewModels.MainViewModel
unknown.png
unknown.png
unknown.png
Was this page helpful?