HELP: Object reference not set to an instance of an object

  • Thread starter Thread starter Tee
  • Start date Start date
T

Tee

Hi,

I having a problem with my asp.net project.
The project work fine on my own PC, but when I upload it to the server, I
got the following error :

Object reference not set to an instance of an object

I have try to search for the solution using this error message, and I found
that a lot of other people have the same problem as the project only work in
their own PC. But so far I haven't get any answer that could solve this
question. Anyone know why is this happen and how to fix it ?

Thanks,
Tee
 
Several possibilities come to mind:

1. You may be missing a .NET reference on the server. Are all your
references (non-GAC) included in your bin directory?
2. You may be using COM Interop and the COM server you are referencing does
not exist on the IIS server.
3. You may be expecting a value to be set and the value is non-existant
outside your environment, leaving the variable uninitialized.
4. Any number of other possibilities.

If you are in control of the server, try Remote Debugging the application on
the IIS server and step through the code. Otherwise, try adding Trace
objects and listeners to write out application state periodically to an
event log or text file.

John Sturgeon, MCP, MCSD
BizTech Solutions, Inc.
 
Isn't we just upload all the needed dll to the bin folder ?

I have set those COM copy local = true ...

Any Idea ?

Thanks,
Tee
 
I would try a few things:

1. Create a web project that does not use a code-behind file. Just a
simple WebForm1.aspx. See if you get the same error with this web
project.

2. Is the .NET framework installed properly? The .NET framework should
be installed after IIS has been installed. Otherwise, you will need to
run some utility to uninstall and reinstall ASP.NET.

Tommy,
 
I am using a shared hosting. It is windows 2003, win2k3 come with .NET
framework, so this shouldn't be the problem, right ?
 
Not in the case of COM components. They MUST exist on the server that you
are executing your application from.

COM components must be registered on the server that they are used from,
i.e. in the registry. The Interop DLL is copied into the bin directory, but
it is just a proxy class. It is a translation layer between .NET and COM.
It needs to be able to access the actual COM server.

Hope this helps,

John
 
Back
Top