I know that there a lot of questions about this problem. but any of the answers solved me it: I use VisualStudio 2013. I have a sulation with a Wpf project. I create for example a public class, and I want to define a data template for this type in Xaml code so I add a reference to the viewModel directory- xmlns:vm="clr-namespace:MyProject.ViewModels" then I add a dataTemplate . I get an error: The name "MainViewModel" does not exist in the namespace "clr-namespace:MyProject.ViewModels" I try all the sulations: rebuild it, restart VisualStudio, delete the suo file, debug it in AnyCpu and then switch it back to X64. I try to delete this row, and when I begin to write it, this row is completed auto, so I havn't spelling mistakes. But although all, I get this error (for all the xaml references to files in my project), I know that there a lot of questions about this