WPF, 'Object reference not set to an instance of an object' in Designer

后端 未结 8 2272
一个人的身影
一个人的身影 2020-12-01 08:58

I\'m getting an \"Object reference not set to an instance of an object\" error when I try to reload the Designer for my XAML UserControl. Visual Studio highlig

8条回答
  •  醉酒成梦
    2020-12-01 09:55

    I was having this error today after editing a lot of XAML in my UWP code and I couldn't figure out what was wrong... but after some close inspection, I noticed this mistake I had made:

    I assigned my Command to the Click handler by mistake, and that resulted in a null reference exception... After changing Click to Command, the error went away.

    XAML error reporting needs to be improved!

提交回复
热议问题