Skip to content
/

When you want to use the PSI interface you need to have a PSContextInfo Class. Inside a Project Server Event this will be provided so you don’t need to worry about it’s contents. But outside the Event you will need to create one from scratch.
One of the properties you need is the Site GUID. According to the SDK you can get this value in your code using three different methods.
I use the third option in my application, but it returned the wrong GUID. After some debugging I finally found the problem.

When you want to use the PSI interface you need to have a PSContextInfo Class. Inside a Project Server Event this will be provided so you don't need to worry about it's contents (except when you want to impersonate as a different user). But outside the Event you will need to create one from scratch.
One of the properties you need is the Site GUID. According to the SDK you can get this value in your code using three different methods:

  1. Hard-code the GUID (Not very flexible)
  2. Use the Windows SharePoint Services SPSite.ID property in the Windows SharePoint Services (Very heavy on resources)
  3. Call the SiteData Web Service with the PWA URL (The best solution, if you ask me)

I use the third option in my application, but it returned the wrong GUID. After some debugging I finally found the problem, I requested the URL http://localhost/PWA/ and there I made my mistake. The trailing / results in getting the GUID of the root site, not the PWA site!

I'm sure I'm not the first one falling in this pitfall, but I'm writting this to prevent you from doing the same.

/

I was browsing through the Project Server 2007 TimePeriodDataSet.TimePeriodsRow Members and found the following empty entries I could fill.

I was browsing through the Project Server 2007 TimePeriodDataSet.TimePeriodsRow Members and found the following empty entries I could fill:

Name Description Enumeration
RES_TIMESHEET_MGR_UID Specifies the resource unique identifier of the (next) enterprise resource reviewing on this timesheet.
TS_WEEK_STARTS_ON Specifies the first day of the week for this timesheet. 0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
WPRD_UID Specifies the period unique identifier of the timeperiod.
/

To deploy our code we create MSI installers using Visual Studio. One problem I encountered is that there is no property available in code to know where the user has chosen to install the application.

To deploy our code we create MSI installers using Visual Studio. One problem I encountered is that there is no property available in code to know where the user has chosen to install the application.
After some searching and testing I now use the following code to get the installation path:

// Installer Application Folder
string installPath = Context.Parameters["assemblypath"];
installPath = installPath.Substring(0, installPath.LastIndexOf("\\"));

if (!installPath.EndsWith("\\"))
{
    installPath += "\\";
}

That's all!