i have used this code but when i deploy nothing changes :
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
if (site != null)
{
SPWeb topLevelSite = site.RootWeb;
string webAppRelativePath = topLevelSite.ServerRelativeUrl;
if (!webAppRelativePath.EndsWith("/"))
{
webAppRelativePath += "/";
}
foreach (SPWeb web in site.AllWebs)
{
// Activate the publishing feature for all webs.
web.MasterUrl = webAppRelativePath + "_catalogs/masterpage/-collabspace.master";
web.CustomMasterUrl = webAppRelativePath + "_catalogs/masterpage-collabspace.master";
web.SiteLogoUrl = "/Style%20Library/labspace/images/-logo.jpg";
string groupName = "Ma-SolCollab";
string groupDescription = "Group for CollabSol";
try
{
CreateSubSiteGroup(SPContext.Current.Web, groupName, "Full Control", groupDescription);
}
catch (Exception ex)
{
string message = ex.Message;
}
}
}
private static void CreateSubSiteGroup(SPWeb web, string groupName, string PermissionLevel, string groupDescription)
{
SPUserCollection users = web.AllUsers;
SPUser owner = web.SiteAdministrators[0];
SPMember member = web.SiteAdministrators[0];
SPGroupCollection groups = web.SiteGroups;
groups.Add(groupName, member, owner, groupDescription);
SPGroup newSPGroup = groups[groupName];
SPRoleDefinition role = web.RoleDefinitions[PermissionLevel];
SPRoleAssignment roleAssignment = new SPRoleAssignment(newSPGroup);
roleAssignment.RoleDefinitionBindings.Add(role);
web.RoleAssignments.Add(roleAssignment);
web.AllowUnsafeUpdates = true;
web.Update();
web.AllowUnsafeUpdates = false;
}