Why can't Visual Studio find my WPF InitializeComponent method?

前端 未结 14 1346
失恋的感觉
失恋的感觉 2020-12-16 08:49

This is very strange.

I have an XAML file that looks as follows...



        
14条回答
  •  误落风尘
    2020-12-16 09:27

    This happened to me because Visual Studio sets the "Build action" to some random action when you copy/paste or move an XAML file from one project to another within a solution.

    Solution: Make sure your "Build action" is set to page for you XAML.

    I hope this helps if it's the same case for you.

提交回复
热议问题