Home All Groups Group Topic Archive Search About

NullReferenceException

Author
24 Sep 2006 7:54 AM
Stelios
Hi.

I have a problem with an error that i get and mayby domebody can help.
I have a project that which gives a pop-up error when i open the
project with VS.
The error is :"The following Exception has occured.
NullReferenceException:Object reference not set to an instance of an
object".

The strange part of this error is that i receive it immediatly when i
open the project.
After Clicking  the OK button, the project compiles and runs with no
problems.

How can i figure out what is this?

Thanks in advance
Stelios

Author
25 Sep 2006 3:12 PM
Chris Dunaway
Stelios wrote:
Show quoteHide quote
> Hi.
>
> I have a problem with an error that i get and mayby domebody can help.
> I have a project that which gives a pop-up error when i open the
> project with VS.
> The error is :"The following Exception has occured.
> NullReferenceException:Object reference not set to an instance of an
> object".
>
> The strange part of this error is that i receive it immediatly when i
> open the project.
> After Clicking  the OK button, the project compiles and runs with no
> problems.
>
> How can i figure out what is this?
>
> Thanks in advance
> Stelios

The popup should have a link that shows the stack trace.  If not, you
could fire up a new instance of Visual Studio and connect to the first
instance using the debugger, perhaps that will let you find the
exception.
Author
25 Sep 2006 8:23 PM
darren.smurf
If this is your own code, change it to be like the following:

Try
   {your code here}
Catch ex as Exception
   msgbox(ex.Message & VbCrLf & ex.StackTrace)
End Try

This will give you information on where and what is causing the null
reference.

Stelios wrote:
Show quoteHide quote
> Hi.
>
> I have a problem with an error that i get and mayby domebody can help.
> I have a project that which gives a pop-up error when i open the
> project with VS.
> The error is :"The following Exception has occured.
> NullReferenceException:Object reference not set to an instance of an
> object".
>
> The strange part of this error is that i receive it immediatly when i
> open the project.
> After Clicking  the OK button, the project compiles and runs with no
> problems.
>
> How can i figure out what is this?
>
> Thanks in advance
> Stelios
Author
27 Sep 2006 7:42 PM
Stelios
Hi.
Thanks for your comments!.
There is no link in the pop up window. and the problem was that i could
not find out what is the reason for this error, since it was appearing
immediatly when i was opening the solution file.
After having a detailed look at the project objects that i have draged
from the toolbox, I noticed that one dataset icon was disappeared!.
I created a new dataset object again, i set up again all the data
bindings and everything was OK.
I read that there is a problem with VS2003 about items that get
dissapeared and that microsoft has a hot fix for this.

Thanks
Stelios Halkiotis


Ο/Η darren.sm***@gmail.com έγραψε:
Show quoteHide quote
> If this is your own code, change it to be like the following:
>
> Try
>    {your code here}
> Catch ex as Exception
>    msgbox(ex.Message & VbCrLf & ex.StackTrace)
> End Try
>
> This will give you information on where and what is causing the null
> reference.
>
> Stelios wrote:
> > Hi.
> >
> > I have a problem with an error that i get and mayby domebody can help.
> > I have a project that which gives a pop-up error when i open the
> > project with VS.
> > The error is :"The following Exception has occured.
> > NullReferenceException:Object reference not set to an instance of an
> > object".
> >
> > The strange part of this error is that i receive it immediatly when i
> > open the project.
> > After Clicking  the OK button, the project compiles and runs with no
> > problems.
> >
> > How can i figure out what is this?
> >
> > Thanks in advance
> > Stelios