SharePoint Events

  5/13/2013 - Conference: SharePoint Summit 2013
  5/21/2013 - Webcast: SharePoint 2013 and ECM: Content Migration and Storage
  5/22/2013 - Webcast: Managing CAD in SharePoint
  5/23/2013 - Webcast: SharePoint Document Automation and E-Forms for Financial Services
  5/24/2013 - Webcast: What's New in Search for SharePoint 2013

 SharePoint Videos

  Why SharePoint 2013
  SharePoint 2013 Launch
  SharePoint 2013 Migration and Governance
  SharePoint 2013 and Enterprise Content Management
  Top Benefits of SharePoint 2013
  What's New in Business Intelligence in Office and SharePoint 2013
  SharePoint and Office 2013 Integration
  SharePoint 2013 Infrastructure Preview
  SharePoint, Lync, and, Exchange in the Cloud with Office 365
  Advanced Reporting in SharePoint with Microsoft Power View

 Archives

Opening SharePoint Links in a new windowUse SHIFT+ENTER to open the menu (new window).
Mail Enabled Lists vs. The Missing Windows 2008 POP3/IMAP Server Use SHIFT+ENTER to open the menu (new window).
7 Tools for SharePoint DevelopersUse SHIFT+ENTER to open the menu (new window).
Public Facing Masterpage TechniquesUse SHIFT+ENTER to open the menu (new window).
How to Quickly Deploy and Activate a Timer Service to Your Site CollectionUse SHIFT+ENTER to open the menu (new window).
Custom SharePoint Master Page Feature with WSP BuilderUse SHIFT+ENTER to open the menu (new window).
Date Math with InfoPathUse SHIFT+ENTER to open the menu (new window).
Enterprise Search Tricks and Tips Part 1Use SHIFT+ENTER to open the menu (new window).
Populating Word Documents With SharePoint Data. Try The DIP!Use SHIFT+ENTER to open the menu (new window).
Programmatic Deep Dive into Blank SharePoint Lookup ColumnsUse SHIFT+ENTER to open the menu (new window).
1 - 10 Next
Helpful Debugging with SharePoint C Sharp Code Pt. 2

By: Kathryn Bartlett

Earlier this year we discussed debugging by creating a Notes Column, a Notes List, using DateTime. Now, and by using Version counts.  This article can be accessed here. In this article, we will discuss yet another way called “Attaching to Process” using the Visual Studio 2010 debugger. 

Step 1: Insert Breakpoints in your C Sharp Code

In Visual Studio 2010, insert breakpoints in your C Sharp code where you want to begin stepping through. You can do this either by clicking to the left of the window where your code resides (circled in red below) or by right-clicking the line you wish to insert a breakpoint at, expanding the “Breakpoint” menu, and clicking “Insert Breakpoint”.

Helpful_Debugging_With_SharePoint_C_Sharp_Code

Step 2: Attaching to Process

In Visual Studio 2010, go to the “Debug” menu, and click “Attach to Process”. 

Helpful_Debugging_With_SharePoint_C_Sharp_Code

 

Check the two checkboxes circled below.

Helpful_Debugging_With_SharePoint_C_Sharp_Code

Step 3: Select the Appropriate Process

Select the appropriate processes and keep clicking attach until all the processes have been attached.  To attach to SharePoint 2010, the correct process is w3wp.exe.  Select all the w3wp.exe processes visible in the list, and click “Attach” until the dialog above disappears from the screen.  Selecting this process will attach to all site, list, and item event receivers in addition to workflows.  To attach to a timer job, the process to attach to is OWSTIMER.EXE. 

Step 4: Run the Code via SharePoint

Next, go to your SharePoint site and run the code you wish to test.  The breakpoint in Visual Studio should become highlighted in yellow.  If the breakpoint doesn't get hit, redeploy your code from Visual Studio 2010; the code you are stepping through must be the most recent version deployed to your SharePoint server.

By: Kathryn Bartlett

        

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Your Name *


e-mail address *


Website (optional)


Comment *


Attachments

 Subscribe

  GigWerks RSS  Gig Werks Mailing List 

 Contact Us

 Connect

 Resources

  On Demand SharePoint Webcast Recordings
  Upcoming Webinars
  SharePoint Resources
  Business Intelligence Resources
  Gig Werks Website



©2009 Gig Werks. All rights reserved. Privacy Policy