Live Chat Icon For mobile
Live Chat Icon

Why would I be getting a NullReferenceException in Windows Forms with no application code in the call stack

Platform: WinForms| Category: Tips

The CLR is catching an Access Violation that’s being thrown from unmanaged code, and that is propagating up as a NullReferenceException. I’ve seen this happen with certain common control library windows types if an
application such as spy++ is running, and I see this is the TreeView control that is having troubles with a mouse down. Have you done any modification to the control through P/Invoke methods?

(from on microsoft.public.dotnet.framework.windowsforms)

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.