Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows Server

Developing with SharePoint 2010 (part 4) - Developer Toolbar

2/6/2013 4:42:53 PM

5. Developer Toolbar

A new addition to SharePoint 2010 is the Developer Toolbar. The easiest way to understand what the Developer Toolbar does is to see it in action. At the time of writing, the only way to activate the Developer Dashboard is via PowerShell or the STSADM tool. Since STSADM is being phased out as a mechanism for managing SharePoint, we’ll use the PowerShell method:

  1. From the Start menu, choose SharePoint 2010 Management Shell from the Microsoft SharePoint 2010 Products menu.

  2. Type the following PowerShell commands at the prompt:

          $dash = [Microsoft.SharePoint.Administration.→
          SPWebService]::ContentService.DeveloperDashboardSettings;
          $dash.DisplayLevel = 'OnDemand';
          $dash.TraceEnabled = $true;
          $dash.Update()
    

    Using this script, we’re setting the Developer Dashboard to OnDemand mode; other possible options are On and Off.

  3. Now if we navigate to the demo site that we created earlier, we can see that a new icon has appeared in the upper-right corner, as shown next. Clicking this icon enables or disables the Developer Dashboard.

With the Developer Dashboard enabled, you can see that every page now has additional information appended to the bottom, as shown. You can use this information to track errors that have occurred during page processing as well as resource usage and other important metrics.

Another important feature of the Developer Dashboard is that it allows developers to write custom tracing information to it. Although I mentioned that DebugView is an important tool for debugging complex applications, when it comes to debugging and diagnosing problems at the user-interface level, the Developer Dashboard provides much more information and is therefore a better solution. Where DebugView proves useful is in debugging issues that don’t occur in the user interface—for example, issues in workflows or asynchronous event handlers .

Monitoring information from code that is wrapped within a SPMonitoredScope object, as shown, is written to the ULS logs as well as being visible from the Developer Dashboard. As a result, using SPMonitoredScope is a good way to generate tracing information that can be used by administrators to troubleshoot problems on a production system.

using (new SPMonitoredScope("My monitored scope"))
  {
    //Code to be monitored
  }

6. Sandboxed Solutions

One of the most common causes of system instability in SharePoint farms is custom code. To provide administrators with more control over the custom code that runs on a farm, SharePoint 2010 introduces the concept of a sandboxed solution. As the name suggests, a sandboxed solution is a custom code solution that runs in an isolated sandbox. From an administrative perspective, a number of configurable options are available for sandboxed solutions, such as specifying resource quotas and monitoring performance.

Sandboxed solutions run in a separate process, whereas other types of solutions run directly within the appropriate SharePoint process. In addition to running in a separate process, sandboxed solutions can utilize only a subset of the SharePoint Object Model. A custom code access security (CAS) policy is applied to prevent sandboxed code from performing actions that could jeopardize system stability.

When you’re creating a new SharePoint project using Visual Studio, you’ll see an option to select a sandboxed solution or a farm solution. Bearing in mind that sandboxed solutions have access only to a subset of the SharePoint API, when you deploy as a sandboxed solution option, Visual Studio IntelliSense displays assistance only for objects and members that are available. Having said that, there is a catch: although IntelliSense doesn’t provide assistance for inaccessible members, it is still possible to write code using them. Such code will compile and deploy fine but will throw an error at runtime.

Debugging Sandboxed Solutions

As mentioned, sandboxed solutions run under a separate process. To debug such solutions, you need to connect to the SPUCWorkerProcess.exe process manually using the Debug | Attach to Process option in Visual Studio.

Managing Sandboxed Solutions

Sandboxed solutions are managed from the Solutions Gallery, which is maintained at the site collection level. To access the Solutions Gallery from any site, take the following steps:

  1. From the Site Actions menu, select Site Settings.

  2. On the Site Settings page, if it’s available, select Go To Top Level Site Settings.

  3. Click the Solutions link in the Galleries section.

Other -----------------
- SQL Server 2008 R2 : Creating and Managing Stored Procedures - Viewing Stored Procedures
- SQL Server 2008 R2 : Creating and Managing Stored Procedures - Deferred Name Resolution
- Using Microsoft SharePoint with Microsoft Dynamics CRM Functions (part 2) - Displaying Data Using BDC in Microsoft Office SharePoint Server
- Using Microsoft SharePoint with Microsoft Dynamics CRM Functions (part 2) - Displaying Data Using BDC in Microsoft Office SharePoint Server
- Using Microsoft SharePoint with Microsoft Dynamics CRM Functions (part 1) - Displaying Data in SharePoint Using the List Web Part for Microsoft Dynamics CRM 4.0
- Microsoft Exchange Server 2007 : Single Copy Clusters (part 2) - Installing Exchange Server 2007 on the Active Node
- Microsoft Exchange Server 2007 : Single Copy Clusters (part 1)
- Windows Server 2003 on HP ProLiant Servers : Logical Structure Design (part 5) - Trust Definitions
- Windows Server 2003 on HP ProLiant Servers : Logical Structure Design (part 4) - Group Policy
- Windows Server 2003 on HP ProLiant Servers : Logical Structure Design (part 3) - Naming Standards
- Windows Server 2003 on HP ProLiant Servers : Logical Structure Design (part 2) - Forest Structure, OU Structure
- Windows Server 2003 on HP ProLiant Servers : Logical Structure Design (part 1) - Domain and OU Structure
- Microsoft Dynamics GP 2010 : Preventing Errors in Dynamics GP - Ensuring proper year-end closing by checking Posting Types
- Microsoft Dynamics GP 2010 : Preventing Errors in Dynamics GP - Preventing account selection errors with Chart Segment names
- Monitoring Windows Small Business Server 2011 : Using Windows SBS Console Monitoring (part 3) - Creating and Viewing Reports
- Monitoring Windows Small Business Server 2011 : Using Windows SBS Console Monitoring (part 2) - Using Notification Settings
- Monitoring Windows Small Business Server 2011 : Using Windows SBS Console Monitoring (part 1) - Using the Network Essentials Summary
- System Center Configuration Manager 2007 : Operating System Deployment - Boot Images
- System Center Configuration Manager 2007 : Operating System Deployment - Site Systems
- BizTalk Server 2006 : Pipeline Component Best Practices and Examples - The Databased Disassembler
 
 
Most view of day
- Sharepoint 2013 : Get to a Site’s Permission Management Page (part 1)
- Windows Phone 7 : The Silverlight Controls (part 7) - Layout Controls - Grid Controls
- BizTalk 2010 : WCF LOB SQL Adapter - Consuming ASDK SQL Adapter in Visual Studio (part 2)
- Microsoft Word 2010 : Creating Desktop Publishing Documents - Adding Page Backgrounds (part 2) - Add or Remove a Page Border , Add Page Color
- Windows Server 2012 : File Services and Storage - Configuring iSCSI storage (part 1) - Understanding iSCSI storage
- Windows Phone 8 : Configuring Basic Device Settings - Backing Up Your Phone (part 2) - Removing Your Backup
- Windows Server 2008 Server Core : Modifying Files with the Edlin Utility, Repairing System Databases with the ESEnTUtl Utility
Top 10
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 3) - Translating Text with the Mini Translator
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 2) - Translating a Word or Phrase with the Research Pane
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 1) - Setting Options for the Research Task Pane, Searching with the Research Task Pane
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 2) - Ending a Linked Notes Session, Viewing Linked Notes
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 1) - Beginning a Linked Notes Session
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 3) - Moving Side Notes to Your Existing Notes
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 2) - Reviewing Side Notes
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 1) - Creating Side Notes
- Games and Windows 7 : Installing and Playing Third-Party Games
- Games and Windows 7 : Using the Games Explorer (part 4) - Managing Your Game Controllers and Other Game-Related Hardware
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro