0

Im creating a blog subsite in the featureactivated event but it errors out everytime i activate the feature. looking at the logs i can see there is an access denied entry however the blog subsite is created fine. Heres my code

    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        LoggerWrapper lw = new LoggerWrapper();

        try
        {
            SPWeb thisWeb = (SPWeb)properties.Feature.Parent;

            using (SPWeb newBlog = thisWeb.Webs.Add(
                "TeamNews", 
                "Team News", 
                "News Blog", 
                1033, 
                "BLOG#0", 
                false, 
                false));

            lw.Information(
                "blog site provisioned for " + 
                ((SPWeb)properties.Feature.Parent).Name, 
                Categories.Event.Information);
        }
        catch (Exception ex)
        {
            string message = 
                "Error provisioning blog site for " + ((SPWeb)properties.Feature.Parent).Name + "\n\n" +
                ex.Message;

            lw.Error(ex, message, Categories.Event.Unexpected);
            throw;
        }
    }
0

I can imagine the error coming from one of the following:

  • The LoggerWrapper - Does the current account have access to write to where it writes? (EventLog?)
  • A feature stabled onto either BLOG#0 or GLOBAL#0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.