2

This problem started occurring yesterday: I am trying to drag a button onto a form in a Windows Forms application, but when I do this I get a NullReferenceException (see screenshot here) When I don't use drag & drop, it works fine.

I'm using Windows 10 1803 together with Visual Studio Community Edition 2017 (version 15.9.14)

Any ideas on what may have caused this? Thanks in advance!

Kit
  • 20,354
  • 4
  • 60
  • 103
wserr
  • 436
  • 1
  • 3
  • 12

2 Answers2

3

Turns out it has nothing to do with Visual Studio or Windows. My second monitor is attached to my laptop with a VGA cable, and it turns out, when I upscale the monitor, the designer in Visual Studio acts weird.

I noticed it because dragging controls worked when visual studio was displayed on my laptop screen, but not on my VGA monitor.

Turning the scale back to 100% (right mouse click on desktop > display settings) solved the issue for me.

Hope this helps someone.

wserr
  • 436
  • 1
  • 3
  • 12
0

Have you tried deleting Visual Studio AppData folder? It is usually at %LOCALAPPDATA%\Local\Microsoft\VisualStudio.

You can also try out Visual Studio Community edition 2019. Maybe in new version this problem won't occur.

grzegorzorwat
  • 405
  • 1
  • 4
  • 13