Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi friends.

i want to know filelistabsolute.txt what is doing in obj folder of program.

before i have a problem that in program running it occur with the message that"object reference not set to an instance of object" and i think it is from this location.

can you please tell me about this file and that error that i said.
maybe this is not a good question or is not a question but thankyou.
Posted
Comments
[no name] 6-Aug-14 11:31am    
http://stackoverflow.com/questions/559045/what-are-all-these-filelistabsolute-txt-files-for
Richard MacCutchan 6-Aug-14 11:33am    
The message "object reference not set to an instance of object" tells you there is a bug in your code. You are trying to use an object that has not been set to any value.
Sergey Alexandrovich Kryukov 6-Aug-14 15:11pm    
What is "obj" folder of a program? There is no such thing. If you mean "obj" sub-directory of the directory of you *.csproj file (project file), it is not related to your application, not available during runtime.
—SA

"filelistabsolute.txt" is a file that Visual studio generates and it contains the list of files built in the current build and in prior builds, and is used during a Clean and Rebuild to figure out which files to delete.

It is not used by your application, and has absolutely nothing to do with an object reference not set to an instance of an object exception.

The reason you are getting that is that some variable contains null (or a property / method returns null) and you are not checking it prior to using it:
C#
string myString = null;
string newString = myString.Substring(5);
Will cause the problem for example.

Unfortunately, we can't tell you exactly what is null: we can't see your screen, access your HDD, or read your mind.
Fortunately, you have all the tools you need to find it yourself: use the debugger. when you application hits the error, execution will stop, and the debugger will show the line of code that failed. Examine it by hovering the mouse over the variables, and see what is null. Then you can look back through your code to find out why it is null.

Sorry, but that's as much help as we can give, without running your code here!
 
Share this answer
 
Comments
_Starbug_ 6-Aug-14 11:43am    
thannks alot my friend. your advises clear many thing for me. thanks again
OriginalGriff 6-Aug-14 11:57am    
You're welcome!
_Starbug_ 6-Aug-14 12:37pm    
sir this is a link of a picture about error that happen suddenly. i do not know how to correct it.
http://upload7.ir/imgs/2014-08/91406554049784590062.jpg
OriginalGriff 6-Aug-14 12:42pm    
OK - so "no source available" - that means it is detected in system code, rather than yours.
So open the "Call Stack" window (look at the Debug menu, under "Windows" and it's about half way down. Look down the list until you find a file in your code and double click it.
It will take you to the line of code from your source that got you to the place that found the problem.
_Starbug_ 6-Aug-14 13:03pm    
thank for your answer.i do what you said and in last line of output window this text was.
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><description>Unhandled exception<appdomain>NotifyMe.vshost.exe<exception><exceptiontype>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<message>Object reference not set to an instance of an object.<stacktrace> at FreeControls.PersianDateTimePicker.Finalize()<exceptionstring>System.NullReferenceException: Object reference not set to an instance of an object.
at FreeControls.PersianDateTimePicker.Finalize()</TraceRecord>
This error message has nothing to do with this location, unless you intentionally do something about this location in your code, which you should never do (please see my comment to the question).

You did not show where the exception with the message "Object reference not set to an instance of an object" is thrown.

Not to worry. This is one of the very easiest cases to detect and fix. It simply means that some member/variable of some reference type is dereferenced by using and of its instance (non-static) members, which requires this member/variable to be non-null, but in fact it appears to be null. Simply execute it under debugger, it will stop the execution where the exception is thrown. Put a break point on that line, restart the application and come to this point again. Evaluate all references involved in next line and see which one is null while it needs to be not null. After you figure this out, fix the code: either make sure the member/variable is properly initialized to a non-null reference, or check it for null and, in case of null, do something else.

Please see also: want to display next record on button click. but got an error in if condition of next record function "object reference not set to an instance of an object"[^].

Sometimes, you cannot do it under debugger, by one or another reason. One really nasty case is when the problem is only manifested if software is built when debug information is not available. In this case, you have to use the harder way. First, you need to make sure that you never block propagation of exceptions by handling them silently (this is a crime of developers against themselves, yet very usual). The you need to catch absolutely all exceptions on the very top stack frame of each thread. You can do it if you handle the exceptions of the type System.Exception. In the handler, you need to log all the exception information, especially the System.Exception.StackTrace:
http://msdn.microsoft.com/en-us/library/system.exception.aspx[^],
http://msdn.microsoft.com/en-us/library/system.exception.stacktrace.aspx[^].

The stack trace is just a string showing the full path of exception propagation from the throw statement to the handler. By reading it, you can always find ends. For logging, it's the best (in most cases) to use the class System.Diagnostics.EventLog:
http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx[^].

Good luck,
—SA
 
Share this answer
 
Comments
_Starbug_ 6-Aug-14 17:03pm    
thanks for answer.but stack frame show me "external code".
Sergey Alexandrovich Kryukov 6-Aug-14 17:09pm    
Yes, of course, some code is external, but, nevertheless, you get as much information as you possibly can. Usually, it's quite enough to resolve this kind of problems.
—SA
_Starbug_ 7-Aug-14 11:32am    
good things for knowing.thanks.
Sergey Alexandrovich Kryukov 7-Aug-14 12:10pm    
Thank you. Will you accept this answer formally (green "Accept" button)? This is what you really need to be able to do to debug in case of such problems.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900