1 / 33

MOSS Ongelmienselvitys - Mitä nyt kun se ei toimi? Aku Heikkerö, Vesa Juvonen

MOSS Ongelmienselvitys - Mitä nyt kun se ei toimi? Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS). Agenda. Eri lokien hyödyntäminen ja konfigurointi Debuggaus MOSS:ssa Best practices – kuinka vältän turhia virheitä ja hyödynnän alustaa tehokkaasti. Who are we?. Aku Heikkerö

Download Presentation

MOSS Ongelmienselvitys - Mitä nyt kun se ei toimi? Aku Heikkerö, Vesa Juvonen

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MOSS Ongelmienselvitys - Mitä nyt kun se ei toimi? Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

  2. Agenda • Eri lokien hyödyntäminen ja konfigurointi • Debuggaus MOSS:ssa • Best practices – kuinka vältän turhia virheitä ja hyödynnän alustaa tehokkaasti

  3. Who are we? • Aku Heikkerö • Senior Consultant, Team leader, BPIO Service Line, Enterprise Services, Microsoft Finland • Member of a worldwide SharePoint Ranger team • In Microsoft since 2003. Companies before Microsoft – ICL, Fujitsu • Email: aku.heikkero@microsoft.com • Vesa Juvonen • Software Development Consultant, BPIO Service Line, Enterprise Services, Microsoft Finland • In Microsoft since 2006, started IT studies 1996 (graduation took a while). Companies before Microsoft – ICL, Fujitsu, BasWare working as Software Architect, Lead Software Development Engineer etc. • Email: vesa.juvonen@microsoft.com • Blog: http://blogs.msdn.com/vesku

  4. Problemsolving in MOSS

  5. Differentlogsavailable • Event Log • System log to track critical errors • Monitoring tools usually track this log for possible indications of problems • Unified Logging Service (ULS) • More comprehensive log to track what happens in the SharePoint • Logging level can be configured based on environment

  6. Eventlog • All critical errors are raised to event log

  7. ULS Log – Howdoesitwork? • Microsoft.Office.Server.Diagnostics.ULS class called from the code • Unfortunately not public class • Depending on the diagnostic logging settings from the Central administration, messages are logged to disk • By default - c:\program files\common files\Microsoft Shared\Web Server Extensions\12\Logs

  8. Controllogging • Can be done from the Central Administration

  9. Analyzing ULS logs • There are no out-of-the-box tools for viewing the logs • Multiple community tools however available • ULS Log Viewer - http://www.codeplex.com/features/

  10. Using ULS logfromowncode • Code example available from the MSDN • http://msdn2.microsoft.com/en-us/library/aa979522.aspx • Integrate the code to your own solution and use it from code

  11. Logging to ULS

  12. Debugging

  13. Debugging • Code can be debugged using the Attach Process… approach • WSS3.0 Extensions does the trick for you • Learn how to do this also manually • There’s no way to debug the xml files or site provisioning • ULS is your best friend… maybe goofy friend, but good friend…

  14. Usingattach to processmanually

  15. Best Practices

  16. Utilize feature framework • Do not edit Out-Of-the-Box features • Take a copy and build your own • Everything deployed to MOSS should be encapsulated to features; if possible • What can be done automatically it should • All the features deployed within the projects should be marked invisible

  17. UseSolutionpackages • Always use solution packages • Xcopy is not the production proof way to deploy • Solution package deployment requires the applications pools to be recycled • Solution deployment package is nothing more than a cabinet package

  18. Quality, Quality, Quality • Developing and functional testing in Development environment • Deployment for Quality Assurance environment follows Acceptance Testing (done in QA) • Production Deployment after the delivery is approved ready for production

  19. Namingconventions • Use project identifier as the naming convention for the: • Feature folders • Site definititions • WebParts and controls • SiteColumns and Content types • Search scopes • Audiences • Solution packages • And the list goes on....

  20. Test as early as possible • Encapsulate v0.1 as fast as possible • Test every feature as independent functinality • Include test cases for the project documentation

  21. What NOT to dowhendeveloping on WSS • Do NOT modify any SQL database tables or stored procedures • Do NOT directly query SQL database tables or stored procedures • Do NOT modify any file WSS installs • Few exceptions, like the docicons.xml • Do NOT modify xml metadata files after the provision has happen • Do NOT assume you’re running solely with Windows Authentication • Do NOT assume that you’re running on a single machine • Do NOT assume everyone is an admin

  22. DisposingSharePointObjects public void GetSPSiteInfo(String strSite) { using(SPSite oSPsite = new SPSite(strSite)) { foreach(SPWeb oSPWeb in oSPSite.Webs) ProcessWeb(oSPWeb); } } public void ProcessWeb(SPWeb oSPWeb) { foreach(SPWeb oSubWeb in oSPWeb.Webs) ProcessWeb(oSubWeb); }

  23. DisposingSharePointObjects public void GetSPSiteInfo(String strSite) { using(SPSite oSPsite = new SPSite(strSite)) { foreach(SPWeb oSPWeb in oSPSite.Webs) { ProcessWeb(oSPWeb); oSPWeb.Dispose(); } } } public void ProcessWeb(SPWeb oSPWeb) { foreach(SPWeb oSubWeb in oSPWeb.Webs) { ProcessWeb(oSubWeb); oSubWeb.Dispose(); } }

  24. Caching data & Objects public Hashtable GetCachedData() { Hashtable oCachedData = (Hashtable)Cache[“CacheName”]; if(oCachedData == null) { oCachedData = QueryToGetCachedData(); Cache.Add(“CacheName”, oCacheddata, null, DateTime.Now.AddHours(1), TimeSpan.Zero, CacheItemPriority.High, OnRemoveCacheItem); } return oCachedData; }

  25. Caching data & Objects public Hashtable GetCachedData() { lock(object) { Hashtable oCachedData = (Hashtable)Cache[“CacheName”]; if(oCachedData == null) { oCachedData = QueryToGetCachedData(); Cache.Add(“CacheName”, oCacheddata, null, DateTime.Now.AddHours(1), TimeSpan.Zero, CacheItemPriority.High, OnRemoveCacheItem); } } return oCachedData; }

  26. Tips & Tricks • Do not deploy files in to layouts folder • New folder located under the layouts • No updating of system aspx pages • No direct access to the DB • ID guidelines • Document the ID’s per implementation that are used • Each project should have their Sequence of their own • Consider to go with the 64-bit • Use .Dispose method

  27. Tips & Tricks continue… • Reduce Unnecessary round-trips • Test your WebParts • USE Cache as much as possible • Querying Large Lists • If possible use RowLimit in the SPQuery • Updating Large Lists • Instead of OM use WebServices

  28. Let’shave a short look on the example VS solution

  29. Summary • Use event log and ULS log to solve the environmental issues • ULS log has huge amount of information • Utilize ULS log also in your own projects using custom code • Follow the best practices to avoid common pitfalls

  30. Moreinformation • SharePoint community • http://sharepoint.microsoft.com/sharepoint/ • SharePoint product team blog • http://blogs.msdn.com/sharepoint/ • Visual Studio structure used in demos and more guidelines (in future) • http://blogs.msdn.com/vesku

More Related