DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: NullReferenceException when closing main form

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    0

    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.

    //program.cs

    ...
    static void Main()
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    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
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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