Title: MOSS Ongelmienselvitys Mit nyt kun se ei toimi
1(No Transcript)
2- MOSS Ongelmienselvitys - Mitä nyt kun se ei
toimi? - Aku Heikkerö, Vesa Juvonen
- Microsoft Consulting Services (MCS)
3Agenda
- Eri lokien hyödyntäminen ja konfigurointi
- Debuggaus MOSSssa
- Best practices kuinka vältän turhia virheitä ja
hyödynnän alustaa tehokkaasti
4Who 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_at_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_at_microsoft.com
- Blog http//blogs.msdn.com/vesku
5Problem solving in MOSS
6Different 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
7Event log
- All critical errors are raised to event log
8ULS 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
9Control logging
- Can be done from the Central Administration
10Analyzing 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/
11Using 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
12Logging to ULS
13Debugging
14Debugging
- Code can be debugged using the Attach Process
approach - WSS3.0 Extensions does the trick for you
- Learn how to do this also manually
- Theres no way to debug the xml files or site
provisioning - ULS is your best friend maybe goofy friend, but
good friend
15Using attach to processmanually
16Best Practices
17Utilize 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
18Use 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
19Quality, 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
20Naming 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....
21Test as early as possible
- Encapsulate v0.1 as fast as possible
- Test every feature as independent functinality
- Include test cases for the project documentation
22What 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 youre running solely with Windows
Authentication - Do NOT assume that youre running on a single
machine - Do NOT assume everyone is an admin
23Disposing 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)
24Disposing 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()
25Caching data Objects
- public Hashtable GetCachedData()
-
- Hashtable oCachedData (Hashtable)CacheCache
Name - if(oCachedData null)
-
- oCachedData QueryToGetCachedData()
- Cache.Add(CacheName, oCacheddata, null,
- DateTime.Now.AddHours(1),
TimeSpan.Zero, - CacheItemPriority.High,
OnRemoveCacheItem) -
- return oCachedData
-
26Caching data Objects
public Hashtable GetCachedData()
lock(object) Hashtable oCachedData
(Hashtable)CacheCacheName
if(oCachedData null)
oCachedData QueryToGetCachedData()
Cache.Add(CacheName, oCacheddata, null,
DateTime.Now.AddHours(1),
TimeSpan.Zero,
CacheItemPriority.High,
OnRemoveCacheItem) return
oCachedData
27Tips 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 IDs per implementation that are
used - Each project should have their Sequence of their
own - Consider to go with the 64-bit
- Use .Dispose method
28Tips 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
29Lets have a short look on the example VS solution
30Summary
- 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
31(No Transcript)
32More 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
33(No Transcript)