none
psi project event handler problem RRS feed

  • Question

  • Hi:

    This is for Sharepoint 2007, Project Server 2007 running on Windows Server 2008 server.

    I created the handler based on the example from Microsoft.  This is the code.

    using System;

    using

    System.Collections.Generic;

    using

    System.Text;

    using

    Microsoft.Office.Project.Server.Events;

    using

    Microsoft.Office.Project.Server.Library;

    using

    System.Diagnostics;

    using

    System.Net;

    using

    WSSDLL = Microsoft.SharePoint;

    namespace

    TestEventHandler

    {

     

    public class MyEventHandler: ProjectEventReceiver

     

    {

     

    public override void OnPublishing(PSContextInfo contextInfo, ProjectPrePublishEventArgs e)

    {

     

    base.OnPublishing(contextInfo, e);

     

    EventLog myLog = new EventLog();

    myLog.Source =

    "Project Event Handler";

     

    string projectName = e.ProjectName.ToString();

     

    Guid siteGuid = contextInfo.SiteGuid;

     

    string pwaUrl = new WSSDLL.SPSite(siteGuid).Url;

     

    int eventId = 3652;

     

    string logEntry;

    logEntry =

    "Project: " + projectName +

     

    "\nSiteId " + siteGuid.ToString() +

     

    "\nPWA Instance: " + pwaUrl;

    myLog.WriteEntry(logEntry,

    EventLogEntryType.Information, eventId);

     

    }

     

    }

     

    }

     

    I had no problem registering the event handler  and it is in the gac.  It seems like when I tried to publish the project in project client.  The message said it will Job Cancelled by the Server.   It does not give me enough information.

    If I remove the handler, it will publish with no problem.   

    I also use Verbrose Logging on Sharepoint Server.  So far nothing I have seen on there should prevent the project being publish. 

    Any idea.

    Thanks,

    kkmick

     



    Friday, April 15, 2011 2:48 PM

All replies