0

I have a SharePoint project with Event Receivers in it and the solution deploys fine as long as I leave out one specific Event Receiver off the list.

If I add that Event Receiver to the Feature list I get the following error: ‘Error occurred in deployment step ‘Activate Features’:

This project wasn't started by me and I am a bit of a novice when it comes to Event Receiver projects.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • Could you please xml definition of your event receiver? Maybe it points to non existing list? – Yevgeniy.Chernobrivets Dec 07 '13 at 15:05
  • Do you have the visual studio project and a development server with Visual Studio installed. If so, what happens when you deploy the solution from Visual Studio? – Robbert Dec 25 '13 at 18:23

1 Answers1

0

Add this logging method and log messages in the FeatureActivated method. Or you can debug the feature during activation with Visual Studio.

    /// <summary>
    /// Method used for logging errors to a log located at c:\log on the WFE
    /// </summary>
    /// <param name="msg"></param>
    static void LogMessage(string msg)
    {
        StreamWriter wrtr = null;
        try
        {
            wrtr = new StreamWriter("C:\\Logs\\eventreceiver.txt", true);
            wrtr.WriteLine(msg + "--[" + System.DateTime.Now.ToString() + "]" + Environment.NewLine);
            wrtr.WriteLine(Environment.NewLine + "==================================");
        }
        catch (Exception e)
        {
            throw e;
        }
        finally
        {
            if (wrtr != null)
            {
                wrtr.Close();
                wrtr.Dispose();
            }
        }
    }
calorie712
  • 348
  • 4
  • 14