My code is all good now thanks to your precious help, so first of all thanks so much!
However when I try running it using the .exe file I get the error "couldn't load the file or assembly 'ThomsonReuters.Desktop.SDK.Dataccess' or one of its dependencies. The specified file was not found".
Any idea what's going on ? Since the program compiles and works using VS.
Are you launching the executable from the build folder? Or have you copied the executable to another location? If the latter, make sure you include all the dependencies in the application distribution. All the dlls in the build folder need to be included in the application distribution and installed together with the executable in the same folder.
I can't say I understand what's going on. If you're able to successfully run your application from Visual Studio and if you're running the application executable from the build folder I don't see how the executable could be missing its dependencies. As a sanity check make sure you have all of the following files in the build folder: Common.Logging.dll, EikonPipeDll.dll, i18nresource.dll, Newtonsoft.Json.dll, protobuf-net.dll, ThomsonReuters.Desktop.SDK.DataAccess.dll, ThomsonReuters.Udap.BusTools.dll, ThomsonReuters.Udap.Ipc.Managed.Common.dll and ThomsonReuters.Udap.ManagedPS.dll. In addition you also need to have msvcp120.dll and msvcr120.dll either in the build folder or in the PATH. If you have all these files in the same folder along with the executable, then all I can suggest is use Process Monitor application from Sysinternals, which will create a log of all the files the executable is accessing, which will hopefully give you a clue for what it's looking for and not finding.