NullReference Exception

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi,

I built a class project (classproject.dll) and a web
project (webproject.dll). The web project needs to
reference to that class project.

They can compile without error. But, it has runtime error
throwing NullReference Exception of the classproject.dll.

However, I did add reference of the class project to web
project.

The error promots the error that "the object reference had
not been set as independent execute of object".

But, I saw the classproject.dll is in web project > bin
folder.

I saw the debug window which showed:

System.Object {System.NullReferenceException}
System.Object

Thanks for any advice.

Happy New Year!!
 
That just means that there is a bug in your code. It has nothing to do with
project references.

Your code is somewhere trying to use a variable that isn't pointing to an
instance of an object.
 
Tom,

usually, a null reference exception means that upon creating a NEW instance
of classproject, something went wrong and it was unsuccessful. Put a break
point where you create your instance of classproject and make sure that its
actually creating an instance successfully.

Hope this helps

Marco
 
Tom,

Please post a relevant code snippet. It may be a simple problem which
occurs either inside the web or the referenced class project that is
generating a null reference error.

You may want to debug the constructor (and other relevant parts) of
the class object to see what is happening inside the class.
~~~~~~~~~~~~~
Tommie Carter
 
Back
Top