How to Debug Feature Receiver Assemblies in Visual Studio – MOSS 2007

If you try to activate the feature using stsadm command you will not be able to debug the feature receiver assemblies.

Open the Site collection features in

Site Actions ->

Site Settings ->

Modify All Site Settings ->

Site Collection Administration -> Site Collection features

Attach the w3wp.exe process in visual studio. Place breakpoints. […]

How to Force MOSS 2007 Timer Jobs to Execute

Use the Following stadm command to force the timer jobs jobs to execute. no need to wait for the interval to execute the timerjobs. stsadm.exe -o execadmsvcjobs

Programmatically Add User to SharePoint Group

To assign the user to group in MOSS 2007

The following code will add the user to site and to specified group.

private void AddUser(string strSite,string webGroup) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(strSite)) { using (SPWeb web = site.OpenWeb()) { Boolean allowUnsafeUpdate = web.AllowUnsafeUpdates; try { web.AllowUnsafeUpdates = true;

web.SiteUsers.Add(loginName, MailId, […]

Best Practices: Using Disposable Windows SharePoint Services Objects

When am started program using sharepoint objects. I found little bit difficult to understand about the sharepoint objects lifetime and best approach to dispose it. I found the following MSDN article which helps me a lot to learn and understand about sharepoint objects disposal.

Refer it here