Groups | Blog | Home
all groups > visual studio .net debugging > december 2003 >

visual studio .net debugging : Null Reference error in VB.NET2003


Paul S. Natanson
12/22/2003 6:07:37 PM
What is a Null Reference error and how do I fix it?

My newly installed VB.Net2003 gives me a "Microsoft
Development Environment" error message box EVERY time I
try to run/start ANY project - even very simple ones.

The error says:

"An unhandled exception of
type 'System.NullReferenceException' occurred in
system.windows.forms.dll. Additional information: Object
reference not set to an instance of an object."

As best I can determine from the debugger and the help
screens, the error has something to do with de-referencing
the form. But I don't even know what that means.

This happens even when I open a project that contains
nothing more than an empty form. And reinstalling
VB.NET2003Standard did not solve the problem.

What does this error mean? What might be causing it? And
how do I fix it?

Because I doubt that I will ever be able to find this
bulletin board / news group again, I would be most
grateful if, after posting your reply here, you would also
please send it to me in an email. My email address is
paul628xxx@concentricxxx.netxxx with the xxx's removed.

Thanks, Paul S. Natanson (Phone 1-908-630-0406 9 AM - 9
PM eastern USA time) paul628xxx@concentricxxx.netxxx
(remove xxxx's from email address). December 22, 2003

robgruen NO[at]SPAM online.microsoft.com
12/23/2003 7:41:46 PM
Paul,

When setting the link property I was still seeing that the file got copied
to the project directory. Either way, this option does not seem to
available to you via the EnvDTE object. In particular the method to add a
file to a project is: ProjectItems.AddFromFile -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/ht
ml/vxlrfaddfromfilemethodprojectitemsobject.asp.

Thanks! Robert Gruen
Microsoft, VB.NET

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Paul S. Natanson" <paul628@concentric.net>
| Sender: "Paul S. Natanson" <paul628@concentric.net>
| Subject: Null Reference error in VB.NET2003
| Date: Mon, 22 Dec 2003 18:07:37 -0800
| Lines: 35
| Message-ID: <03d901c3c8f9$895225e0$a401280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcPI+YlSVrwDkkJGRq+247sf+HzRAQ==
| Newsgroups: microsoft.public.vsnet.debugging
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.vsnet.debugging:4452
| NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
| X-Tomcat-NG: microsoft.public.vsnet.debugging
|
| What is a Null Reference error and how do I fix it?
|
| My newly installed VB.Net2003 gives me a "Microsoft
| Development Environment" error message box EVERY time I
| try to run/start ANY project - even very simple ones.
|
| The error says:
|
| "An unhandled exception of
| type 'System.NullReferenceException' occurred in
| system.windows.forms.dll. Additional information: Object
| reference not set to an instance of an object."
|
| As best I can determine from the debugger and the help
| screens, the error has something to do with de-referencing
| the form. But I don't even know what that means.
|
| This happens even when I open a project that contains
| nothing more than an empty form. And reinstalling
| VB.NET2003Standard did not solve the problem.
|
| What does this error mean? What might be causing it? And
| how do I fix it?
|
| Because I doubt that I will ever be able to find this
| bulletin board / news group again, I would be most
| grateful if, after posting your reply here, you would also
| please send it to me in an email. My email address is
| paul628xxx@concentricxxx.netxxx with the xxx's removed.
|
| Thanks, Paul S. Natanson (Phone 1-908-630-0406 9 AM - 9
| PM eastern USA time) paul628xxx@concentricxxx.netxxx
| (remove xxxx's from email address). December 22, 2003
|
|
|
Paul S. Natanson
12/23/2003 11:18:30 PM
Robert: I think that you misunderstood my question. I have a brand new
installation of VB.NET2003. I created a brand new project that has nothing
on it other than a blank form. When I click on the start button, I get a
"Microsoft Development Environment" error message box that says: "An
unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll. Additional information: Object reference not set
to an instance of an object."

This happens even when I try to open sample projects written by Microsoft.

What is causing this error and how do I fix it?

PS: I am a novice VB programmer trying to make the transition from VB6 to
VB.NET.

Paul S. Natanson paul628xxx@concentricxxx.netxxx (To reveal my true email
address, simply remove the xxx's.) 12-23-03

xxxxxxxxxxxxxxxx

[quoted text, click to view]

Angel
12/31/2003 5:44:33 PM
I have a similar problem and as far as I can tell it
deals with a memory leak. I have not nailed down the
problem yet and it is not as severe as your case but it
happens under the VS debugger. The app executable does
not exhibit this problem. Anyway, I have an incident
with support on this issue. If you like I can keep you
posted. BTW how much memory do you have? run your
system monitory and see if you are leaking.

regards,
Angel
[quoted text, click to view]
AddThis Social Bookmark Button