"Nullable must be unwrapped" when adding PictureBox Windows Forms control

When adding System.Windows.Forms.PictureBox to a Silver Winforms app, the following error occurs upon a build:

(E484) Cannot access members on wrapped nullable type “System.ComponentModel.ISupportInitialize?”

on the following lines in Main.Designer.Swift:

(self.pictureBox1 as? System.ComponentModel.ISupportInitialize).BeginInit()
(self.pictureBox1 as? System.ComponentModel.ISupportInitialize).EndInit()

In the code editor the tip “Nullable must be unwrapped” appears beside the lines above.

Sounds like a codegen bug. since

(self.pictureBox1 as? System.ComponentModel.ISupportInitialize)

is a nullable, this needs

(self.pictureBox1 as? System.ComponentModel.ISupportInitialize)?.BeginInit(),

of course. Will log.

Thanks, logged as bugs://80627

bugs://80627 got closed with status fixed.

I am not using a build that has this bug fixed yet, but I just want to add that the same issue happens with a SplitContainer… not sure if that (and other controls) gets fixed for this issue as well.

Probably the same issue.

.2311 has the fix; it’s building now and should be out later today.

Can you send the 10.0.2311 build to my account, username “jbperez808”

Thanks!

Sure thing!