Cascade Skyline - with Microsoft Logo and Project Support header - author Brian Smith

  • Brian Smith's Microsoft Project Support Blog

    One event handler and multiple PWA sites - Where did that event come from?


    An interesting support case came in through our EMEA team (thanks Valdemar) where a customer had a single event handler that was registered in different sites - but when the event was raised they needed to know which site fired it - so they could make the necessary updates against the right site.  In this case they were updating the list of projects in different categories - both on the publishing and check-in events.

    So, how do you find out?  The event itself has a parameter of contextInfo and one of the properties that gets set for events is the SiteGuid - which is actually the SiteId of the WSS site hosting PWA.  So this can identify the instance of PWA.  The next step to getting a URL rather than the GUID is to create a new instance of SPSite using this GUID and then simply read the URL property.  So a full event handler that has the extra reference to the required SharePoint library and writes the Project name, the Site ID and the Project Server URL out to the event log would look like this:-

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Net;

    using System.Text;
    using Microsoft.Office.Project.Server.Events;
    using Microsoft.Office.Project.Server.Library;
    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";

                // Get information from the event arguments, and
                // write an entry to the Application event log.
                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);


    Not very useful in that state - but you can add some extra stuff to do some real work.  They key thing is you don't have to deploy different event handlers for each instance of PWA - just deploy once and then register in each of the PWA instances you want to use it.  And no need to modify your event handler just because you add a new PWA site to your system.  See the Project Server 2007 SDK for an end-to-end explanation of creating and debugging Project Server 2007 event handlers.


    Technorati Tags:

  • Brian Smith's Microsoft Project Support Blog

    Adding Timephased Actual Work through the PSI


    There is some great content in the SDK on statusing (search for SubmitStatus and UpdateStatus) and even more coming soon.  One of the missing pieces just at the moment is around adding timephased data.  So here is a very brief example.  See the SDK for better examples of programmatically building the XML - but the key piece is the format of the XML passed to the statusing.UpdateStatus web service.  In my example I have a 5 day task assigned to me starting next Monday - and I want to update the actual work in my tasks to show 8h on Monday the 5th and 8h on Wednesday the 7th.  The XML for this change is as follows:- 


    <Proj ID="a3349ba9-7eb8-4921-9024-483d0a732f1a">

    <Assn ID="dd6a2aa8-b754-48b5-a6fe-b5cd50cea19b">

    <PeriodChange PID="251658250"  Start="2007-02-05T08:00:00" End="2007-02-05T17:00:00">480000</PeriodChange>

    <PeriodChange PID="251658250"  Start="2007-02-07T08:00:00" End="2007-02-07T17:00:00">480000</PeriodChange>






    ·         a3349ba9-7eb8-4921-9024-483d0a732f1a is my Proj ID,

    ·         dd6a2aa8-b754-48b5-a6fe-b5cd50cea19b is my Assignment ID

    ·         The PID 251658250 means s_apid_actual_work (or Actual Work - from PSLibrary.AssnConstID.s_apid_actual_work - see SDK for more details of these constants)

    ·         Start and End time format is critical – the ULS logs are good at giving help when you get a LastError=StatusingInvalidChangelist Instructions exception.

    ·         480000 = 8 hours



    So executing the statusing.UpdateStatus(changeXml); where the changeXml is the same as presented above will do exactly the same as entering the two lots of 8hrs in through PWA.  Tuesday will be updated to 0h planned work (because I have entered actual work for Wednesday)  - and 8h will be pushed back to next Monday.

    Technorati Tags:

  • Brian Smith's Microsoft Project Support Blog

    You don't need to install WSS v3 before Project Server 2007


    One common issue we see, particularly from customers familiar with Project Server 2003 is that they will install WSS v3 before Project Server 2007.  This is an unnecessary step and in some cases can then make it difficult to install Project Server 2007 in precisely the way that you want.  For instance if WSS is installed then it can install a SQL Express instance for its databases.  Then when you install Project Server it follows the lead of WSS and also uses SQL Express - when you really wanted to load the databases in another instance of SQL Server 2005.  Just installing Project Server 2007 will also install all the bits of WSS you need and allows either a "standalone" install - which does use SQL Express, or you can choose "Advanced", followed by "Complete" and this will allow a choice of SQL Servers to connect to.  Often a customer will choose standalone to mean that SQL will be on the same server - but will not intend to use SQL Express - but a full SQL Server 2005 database engine that is also running on the server.  Standalone does not give you the choices - but Advanced and then Complete does.

    Technorati Tags:

  • Brian Smith's Microsoft Project Support Blog

    Project Server 2007 SQL Server Reporting Services Report Pack - Now available


    This will be part of the SDK in the April update - for now you can find it at the Project blog at

    "The Project Server 2007 Report Pack provides usable reports for some common requests and illustrates some of the new functionality in Microsoft Office Project Server 2007.  The Report Pack also provides report developers with sample queries for correctly retrieving data from the Project Server Reporting database."


    Technorati Tags:

  • Brian Smith's Microsoft Project Support Blog

    Editing ASP.NET Configuration in InetMgr can break WSS!


    I am working on some internal training at the moment on the use of alternative authentication methods for WSS and Project and am playing about with LDAP.  Having shot myself in the foot by leaving a web.config open and then later saving it over a version that WSS had modified I thought I would take a look at the option within InetMgr (IIS Manager) that allows the editing of the web.config and a nice little UI.  Perhaps safer than notepad?  I was setting WSS to use two different LDAP providers on two different ports - but the Central Admin site needs to know about both of them.  Uncharted territory for me - so when things broke my first guess was that my XML was somehow wrong for adding a second provider - although the UI in InetMgr seemed happy with my addition.  Symptoms of the break for me were "File Not Found" on the Operations and Application Management tabs - and the home page went to a Server Error in '/' Application that wouldn't display anything other than the custom error no matter what I tried. 

    So I removed my XML and the problem stayed.  As part of my training was to be comparing web.config files at various points during the training I took my own medicine and fired up windiff.  And there it was - the edit configuration option had added an attribute to my <configuration> element.  Instead of just <configuration> on line 2, I had <configuration xmlns="">.  Removing the extra text got my Central Administration site up and running again.

    This is a known issue - KB 917238 - but in case you see these symptoms - take a look at your web.config.

    Let me know if anyone out there is interested in authentication of Project Server 2007 with LDAP and I will blog my findings so far.

    Technorati Tags:

Page 91 of 94 (468 items) «8990919293»