Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object reference exception when drag and dropping from toolbox to Windows Forms designer

When dragging a control from the toolbox and dropping it in the Windows Forms designer, a message box appears with the message Object reference not set to an instance of an object.

After closing the message box, I can drop the control on the form without any other issue.

This happens on a new project as well. The error appears in both VS 2015 and 2017 (both community editions).

EDIT : This happens on any control, including custom ones. This started happening after I updated to the latest version of Windows 10 (17134.48).

like image 523
CristisS Avatar asked May 23 '18 14:05

CristisS


2 Answers

Instead of dragging and dropping, Clicking on the control, then clicking on the form is the workaround working for me until they come out with a newer update.

This is new behavior as of Visual Studio 2017 Version 15.8.6 for me.

Hopefully this will help others that just kept dragging and dropping over and over like I was doing :-)

like image 109
Carl- Avatar answered Sep 18 '22 22:09

Carl-


Experiencing the same issue on Microsoft Visual Studio Community 2019 Version 16.5.0. I found that I was not able to drag and drop controls while VS was open on my high DPI external monitor, but if I moved VS to my native laptop monitor, I was able to drag and drop the controls.

like image 34
RJohnson Avatar answered Sep 18 '22 22:09

RJohnson