I had this problem, too.
Possible causes in my case: I had deleted a duplicated view twice and a view model.
I reverted one of the deletes and then the InitializeComponent error appeared.
I took these steps.
- I checked all of the solutions mentioned on this question. The class
name and build action were correct.
- I Cleaned my Solution and rebuilt. Another error appeared. "Error CS2001: Source file '.cs' could not be found"
- I found this answer and followed the steps.
- I reloaded the project and cleaned/rebuilt again.
- My solution builds without errors and my application works now.