The name ViewModel does not exist in the namespace “clr-namespace:Project.ViewModels”

前端 未结 18 1845
旧时难觅i
旧时难觅i 2020-12-04 23:55

Now that\'s a real strange error. I am working on a WPF application and following MVVM. In my MainWindow I am setting views and view models and I get this strange error. Alt

18条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 00:42

    Close and reopen Visual Studio.

    I tried some of the answers here (I'm using VS2012 with Resharper), and I was doing everything ok, but still had the error. I was even able to navigate to my bound fields using Resharper's 'cntl'+click, but was still getting XAML compile errors and designer wouldn't show the design view. Closing visual studio and reopening fixed it for me.

提交回复
热议问题