Thursday 2 October 2014

BUILDING AND USING MS PROJECT 2010 PROXY ASSEMBLY FOR WCF PSI SERVICE

To do the task of integrating Microsoft Dynamics NAV 2009 R2 and MS Project Server 2010 I have decided to use WCF interface. WCF interface is provided by PSI (Project Server Interface) which has both ASMX object model and WCF object model implemented.
There are three options for communicating with WCF interface of MS Project Server:
  1. Compiling ProjectServerServices.dll PSI proxy assembly.
  2. Add a PSI proxy source code to the Visual Studio solution.
  3. Add a service reference by using Visual Studio.
I have decided to use the first option and compile ProjectServerServices.dll proxy assembly.

Project 2010 SDK

First you need to download and install Project 2010 SDK from Microsoft Download site http://www.microsoft.com/en-us/download/details.aspx?id=15511
After you have installed Project 2010 SDK you need to go to the installation folder. In my case that was folder: C:\Program Files (x86)\Microsoft SDKs\Project 2010\Documentation\Intellisense\WCF. Unpack the Source.zip file, found in that folder, so you get the Source subfolder containing C# source files.
Next, you need to start CompileWCFProxyAssembly.cmd to create ProjectServerServices.dll file. The best way to do it is to open Command prompt with administrative privileges (Start->All Programs->Accessories->Command prompt then right click and select Run as administrator), then cd to the C:\Program Files (x86)\Microsoft SDKs\Project 2010\Documentation\Intellisense\WCF and then run CompileWCFProxyAssembly.cmd.

Note: You need to change the path of sn (sn.exe) to the location of Windows SDK in CompileWCFProxyAssembly.cmd. In my case that was C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64\sn.exe.

After the script has run you should have ProjectServerServices.dllin this folder.

Visual Studio

In Visual Studio you shoud add reference by clicking right mouse button on Reference folder in your C# project then select Add reference… option, then select Browse on the left hand side of the Reference Manager window and click Browse… button on the lower side of the window. Navigate to C:\Program Files (x86)\Microsoft SDKs\Project 2010\Documentation\Intellisense\WCF\ProjectServerServices.dllfile and click Add button. Click OK to close the Reference Manager window.

project server 2010 requires at least microsoft internet explorer 7.0

My IE to version 10 for Windows2008 r2. Since then, I was not able to access my project centre. I kept getting this error message
 I tried setting the compatibility mode for this PWA site. Note: You can do this via IE Tools.

Flow below steps 
  • Open Internet Options from Tools menu.
  • Click on Security tab in internet option box.
  • Click on Local Intranet, Then click on Sites button. You will get again a box where you have to click on Advanced button.
  • Put project server url here and then click on Add button.
  • Now close all boxes and Refresh your IE.