Sharepoint Insight by Namwar Rizvi

Sharepoint Tips, Tricks and inside knowledge from real world experience by Namwar Rizvi

How to debug custom application pages in Sharepoint

Posted by namwar on January 9, 2009


To debug your custom application pages located in layouts folder, perform the following steps:

  1. In IIS, select your web application and from context menu, select Open. It will display the directory in windows explorer
  2. Edit Web.config in any text editor (e.g. Notepad)
  3. In web.config, search for compilation node like “<compilation batch=”
  4. To enable debugging, update the node as follows
    • Set batch=false
    • Set debug=true
  5. After update, your compilation node will become <!– /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:””; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:”Times New Roman”; mso-fareast-font-family:”Times New Roman”;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} –>

    <compilation batch=false debug=false>

  6. Launch Internet Explorer and browse your custom application page
  7. Now, launch Visual Studio and open your Custom Application Page from layouts directory
  8. Go to Debug->Attach To Process and attach to w3wp.exe
  9. attachtoprocess1
    attachtoprocess2

  10. Add break points as necessary.
  11. In Internet Explorer, refresh your page and bingo! you can debug your custom application page now.
Advertisements

5 Responses to “How to debug custom application pages in Sharepoint”

  1. Sushil said

    Thanks a lot

  2. Sushil Kr Maurya said

    Many Many Thank you

  3. Sushil Kr Maurya said

    Thanks

  4. Sushil Kr Maurya1 said

    thanksssssss

  5. Sushil Kr Maurya said

    Thank you… You are gr8. I am big fan of you. 🙂

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: