Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Developing with SharePoint 2010 (part 4) - Developer Toolbar

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server