Question : How to read a stack trace in visual studio

I am new to asp.net and am trying to uderstand how to read a stack trace.
Can anyone please explain how this is done?
Thanks John.

An example shows no file or line number:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
   CommerceBuilder.Personalization.SharedPersonalizationDataSource.LoadForPath(String path, Boolean create) +366
   CommerceBuilder.Web.UI.AbleCommercePage.InitializeTheme() +732
   CommerceBuilder.Web.UI.AbleCommercePage.a(Object A_0, EventArgs A_1) +36
   System.Web.UI.Page.OnPreInit(EventArgs e) +8694814
   System.Web.UI.Page.PerformPreInit() +31
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

Answer : How to read a stack trace in visual studio

CommerceBuilder.Personalization is the namespace,
SharedPersonalizationDataSource is the class name
LoadForPath(String path, Boolean create) is the name of the function

Yes line 366 is where this function appears in the source file of SharedPersonalizationDataSource class.

It may be that you dont have the source for this class, if it is a 3rd party library. If that is the case you obviously cannot make any changes to it, so check that all your configuration/call is correct

e.g. path!=null, create!=null , does the path exist? is it a valid path? all these could potentially cause problems.
Random Solutions  
 
programming4us programming4us