DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: NullReferenceException when closing main form

  1. #1
    Join Date
    Mar 2009

    NullReferenceException when closing main form

    I have written a Windows Form Application (standard c# template) in Visual Studio 2008. When I try to close the main form of the debug build, I get an unhandled exception that I can not figure out how to resolve.


    static void Main()
    Application.Run(new Form1()); //NullReferenceException
    //"Object reference not set to an instance of an object"

    Before today, my application was working fine. I'm not sure what I changed to make this happen. Are there any suggestions on where to look and/or how to fix this?

  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    What changed in your envirnoment since yesterday when it was working?

Similar Threads

  1. Error closing form with icon
    By RaYWoLF in forum .NET
    Replies: 2
    Last Post: 03-14-2008, 06:57 AM
  2. Pseudocode Problem
    By zobi316 in forum VB Classic
    Replies: 3
    Last Post: 03-10-2008, 07:05 AM
  3. Replies: 0
    Last Post: 04-11-2002, 06:48 PM
  4. Load a document into the Main form
    By Keflavik in forum VB Classic
    Replies: 4
    Last Post: 07-05-2000, 03:06 PM
  5. Losing control on SetParented form.
    By Mark Alexander Bertenshaw in forum VB Classic
    Replies: 0
    Last Post: 03-16-2000, 01:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center