Download presentation
Presentation is loading. Please wait.
Published byAnne Warren Modified over 9 years ago
3
MOSS Ongelmienselvitys - Mitä nyt kun se ei toimi? Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)
4
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
5
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
6
Problem solving in MOSS
7
Different logs available 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
8
Event log All critical errors are raised to event log
9
ULS Log – How does it work? 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
10
Control logging Can be done from the Central Administration
11
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/
12
Using ULS log from own code 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
13
Logging to ULS
14
Debugging
15
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…
16
Using attach to process manually
17
Best Practices
18
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
19
Use Solution packages 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
20
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
21
Naming conventions 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....
22
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
23
What NOT to do when developing 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
24
Disposing SharePoint Objects 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); }
25
Disposing SharePoint Objects 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(); }
26
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; }
27
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; }
28
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
29
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
30
Let’s have a short look on the example VS solution
31
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
33
More information 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.