Debugging sharepoint Solutions

http://msdn.microsoft.com/en-us/library/ee231550.aspx

>> In web.config, set CallTrack=True
(normally the first question you’re asked when start debugging a solution)

>> Disable custom errors in Visual Studio (<customErrors mode=”Off” />)

>> Enable compilation debugging (<compilation debug=”true”>)

So:

Debugging Feature Receiver – Important


***** when a feature is activated by Visual Studio, it runs in a different process than the
debugger. This means that some debugging functionality, such as breakpoints, will not work correctly.
Solution – Change the solution to “No Activation”, and then debug as usual, and then
manually activate the feature.

Enable Enahnced Debugging Info:

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SharePointTools]
Change the “EnableDiagnostics” key value from “0” to “1.”

Setting this key value to 1 causes stack trace information to appear in the Output window
whenever project

How to Write to trace Log

http://msdn.microsoft.com/en-us/library/ff628564.aspx

Two way to write to log:

(1) using Object Model (Tracing Log API)

SPDiagnosticsBase is the class!!!
WriteTrace & WriteEvent()

(2) SPMonitoredScope


 

 

 

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: