none
OnPublishing event fires and WssUrl is null? RRS feed

  • Question

  • Hi Project guys!

    I'm using ProjectPrePublishEventArgs.WssUrl to get the projects workspace URL. Sometimes the property is set, sometimes it is null... I'm clueless at this point and not able to see a pattern, that may explain this behaviour. Is it intended, am I doing wrong with my usage of this property or is it a bug?

    If there's no help out there, can anyone confirm the reported behaviour at least? Maybe there is a better way to obtain the URL of the correspondig project workspace?

    Any hints or suggestions are kindly appreciated,
    Tomros

     

    Thursday, January 19, 2012 11:48 AM

All replies

  • Hi There,

    It is possible that when the project was created & published, the project manager might not have created a project workspace URL. ProjectPrePublishEventArgs.WssUrl gets the URL of the SharePoint site that is to be created for the project. If you create a workspace of the project which shows the  null value, then again you check ProjectPrePublishEventArgs.WssUrl , It might work for you.

    Alternatively, you can get the Project workspace url from Reporting database using SQL query.

    SELECT  [ProjectUID]
          ,[ProjectName]
          ,[ProjectWorkspaceInternalHRef]
      FROM [dbo].[MSP_EpmProject]



    Hoep that helps.

    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    Thursday, January 19, 2012 11:57 AM
  • Hi Amit,

    Thanks for the quick reply. I'm afraid this is not the cause of the problem. All projects in the server instance has an associated project workspace.  The reported problem occurs at random on the same project without changing anything concerning the associated project workspace:

    e.g.

    -- Project A --> publish 1: WssUrl = set correctly
    -- Project A --> publish 2: WssUrl = null
    -- Project A --> publish 3: WssUrl = set correctly

    Thanks in advance
    Tomros

    Thursday, January 19, 2012 2:10 PM
  • Probably is the WssUrl not mandatory in all the calls that publish a project. Once you have a workspace, you should also be able to obtain it using the WssInterop.ReadWssData Method. I do know, that the creation of the WSS Site is asynchronous - so with a brand new project this may fail. I guess though, that in that case the Url in the event argument is filled.


    Jan Cirpka
    Thursday, January 19, 2012 5:22 PM