Thursday, March 22, 2012

Object reference not set to an instance of an object working in debug mode but not in IIS

Hi have this funny error, working fine when I debug the project in debug mode but has the above error in localhost.

All the page works fine but only one with this error... Anyone know how to solve this problem?

cheers

Hello my friend,

Could you provide some source code and the error details that you get, line number, etc?

Kind regards

Scotty


Hi Scotty,


Sorry for the late reply... I do not know which part of the source code that cause this problem cause when I'm trying to track this error through debug mode, but the program just works fine.

When i try accessing it through the localhost, it just pop up a alert stating the above error...

cheers


hi,

do you have virtual directory in IIS? if no, create it. if yes, provide your full code. so that it will be easy to find out the error.


HiXpy,

Based on my understanding, your web application runs fine with Visual Studio in the debug mode, but when you run it in localhost you get the "Object reference not set to an instance of an object" error message. If I have misunderstood you, please feel free to tell me.

If we run this web application in the localhost on another machine, does it have the same issue?

There are many causes of that this error message will be appear. It is difficult to find the cause without debugger. Please check the code of the page which displays error message and see if there is a mistake or defect in the code.

You can also debug the web application in the localhost with Just-In-Time debugging which is the feature of Visual Studio 2005 Debugger. When a crash occurs with Just-In-Time Debugging enabled, a dialog box appears and then you can choose the Debugger to debug your web application. For more information, seeJust-In-Time Debugging.

I hope this helps.


i agree with the above post you can get this reason because of many reasons which is difficult to find out without debugging, this error is mainly becuase you are using an object without assingin a value or without initializing that object in the code...so check carefully that all the objects are properly intitialized.


Hi Thomas,


Thanks for the feedback, sorry for not getting back... Been quite bz with work so totally forgotten abt this error.. Will try it out and get back... By the way its an application which runs in my office machine, IIS and even server... But when I tried it on my home machine, this error pop up only in one page... Therefore I guess i will need to look in the codes of this particular page...

Thanks all for the feedback

cheers

0 comments:

Post a Comment