MSDN Magazine - March 2009 - (Page 70) following Web service calls. The most important takeaways here are to know where SharePoint logs data and when to make use of a debugger and to be familiar with tools that can help you troubleshoot your SharePoint applications. One place to start when trying to determine what is causing an application problem is the Windows event logs. In some cases, you can use options for increasing event logging. For example, if you are working with an application that relies on Kerberos authentication, you can increase Kerberos logging to the System event log. There are numerous excellent online resources explaining Kerberos authentication. For concise information on verbose Kerberos logging in Windows Server , take a look at “Kerberos Protocol Registry Entries and KDC Configuration Keys in Windows Server ” (support.microsoft.com/kb/837361). The SharePoint and IIS logs are critical to troubleshooting SharePoint application errors. Here’s some brief information about these two critical logging sources: • The SharePoint logs are located at \ Microsoft Shared\Web Server Extensions\\LOGS. You can simplify reading these logs by installing the Log Viewer feature (codeplex.com/features/Release/ProjectReleases.aspx?ReleaseId=2502). • The IIS logs are typically located at \System\ LogFiles. Look in the properties of IIS to verify the root location of the logs. Since each IIS Web application has a unique ID, you just match the IIS application ID for the SharePoint Web application listed in IIS with the folder name under the LogFiles directory. For custom application logging, consider Enterprise Library integration. By incorporating the Enterprise Library Logging and Exception Handling Application Blocks in your code, your logging target, typically a database, can contain logging information and exception detail critical to troubleshooting your custom apps. The most useful tool for debugging custom application problems is the Visual Studio debugger. If you have Visual Studio installed on your SharePoint server, you have F debugging capability. Ideally, you should not have Visual Studio installed on production or model office systems. In addition, you can develop software on local workstations and debug solutions remotely. Remote debugging is fully supported in SharePoint by connecting to the wwp process hosting your custom application in IIS. To determine which instance of wwp is running your application, open a command prompt and run IISApp.vbs on your Windows server to identify the process ID (PID) running your SharePoint Web application. Then, in Visual Studio, select the instance of wwp with the matching PID. Another very helpful tool is Exception Display (code.google.com/p/ rapid-tools). When you enable this tool on your farm, it replaces the friendly SharePoint error page message with a number of exception display types. For details on how to install and use this tool, click “Exception Display” at the link listed above. 70 msdn magazine Keep extending the framework. Sharepoint is more than capable of integrating custom solutions in a variety of ways. If a deployed Web Part is causing a page load failure, you can open the Web Part maintenance page by appending ?content= to the end of the page URL. On the maintenance page, you can close or delete the offending Web Part from the page. Finally, you can enable application-level tracing in the web.config file of your Web application. See the discussion in “Enabling Application-Level Tracing” at msdn.microsoft.com/library/1y89ed7z(VS.71).aspx. Keep extending the framework. SharePoint is more than capable of integrating custom solutions in a variety of ways. Because SharePoint is built on top of ASP.NET, it inherits the extensibility points of this platform. With the release of WSS ./ MOSS SP, Microsoft now supports the ASP.NET AJAX framework, which means you can take advantage of the ASP.NET AJAX Extensions and the AJAX Control Toolkit. You can ease the installation and configuration procedure by using the Ajaxify MOSS custom stsadm extensions (see codeplex.com/ajaxifymoss) that programmatically add or remove AJAX-related web.config entries by using the SPWebConfigModification class. With the framework in place, you can use the AJAX control suite and improve the responsiveness of your pages by implementing client-side callbacks. This is particularly important when making external Web service calls in custom Web Parts. See “Client-Side Web Service Calls with AJAX Extensions” at msdn.microsoft.com/mag- azine/cc163499. jQuery is another client-side framework that is getting a lot of attention, especially with the recent announcement by Microsoft that it will be supported in Visual Studio. Since the jQuery core library is contained in a single .js file, integrating it into SharePoint is simple. See “jQuery Script Manager” at codeplex.com/jQueryScriptManager for an approach to embedding jQuery scripts into an ASP.NET Web page. If you’re looking for information about Silverlight integration, see the article “Light Up SharePoint with Silverlight Web Parts” at msdn.microsoft.com/magazine/dd148643. The authors explore an example of integrating a Silverlight application with SharePoint. 4. Develop Solutions Off-Server Whenever possible, you should build your solutions free of the dependencies that SharePoint development often imposes. By using the Visual Studio development server, ASP.NET Web Part framework support, SharePoint Web services, and third-party tools, you can complete most of your development on a standard workstation rather than on a computer running SharePoint. Because SharePoint runs on top of IIS and ASP.NET, the Web development server included with Visual Studio is an excellent starting point for much of your SharePoint development. For example, you can develop Web Parts, HTTP handlers, and Web controls in this, relatively speaking, lightweight environment. Some initial work is involved in setting up the environment to host your components. For example, to effectively develop an SharePoint Best Practices http://www.msdn.microsoft.com/library/1y89ed7z(VS.71).aspx http://support.microsoft.com/kb/837361 http://www.codeplex.com/ajaxifymoss http://codeplex.com/features/Release/ProjectReleases.aspx?ReleaseId=2502 http://msdn.microsoft.com/magazine/cc163499 http://msdn.microsoft.com/magazine/cc163499 http://www.codeplex.com/jQueryScriptManager http://www.codeplex.com/jQueryScriptManager http://msdn.microsoft.com/magazine/dd148643 http://code.google.com/p/rapid-tools http://code.google.com/p/rapid-tools
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.