Search code examples
c#thrift

How to add Thrift dependencies to a C# project?


Hi I'm trying to use Thrift for a project on Windows, however I don't seem to understand how to get it to work and I don't understand the documentation provided very well either. So far I managed to create the thrift compiler and use it to generate java and c# files. However, when it comes to using them in a simple project I seem to get stuck in the same part. Right now I'm following this tutorial:

http://blog.rfaisal.com/2013/10/09/getting-started-with-apache-thrift/

Which has been quite helpful but, I still don't understand how to add the language libraries, In the tutorial for instance he says:

"At this point, you need to add the thrift library to your project. Open the Thrift C# library from the tarball (should be under /lib/csharp) and compile it."

Later for the Client he says: "Copy the Thrift Java library from the tarball (should be under /lib/java) to this project."

I have both folders, but I'm unsure as of what exactly I should do.

Could someone point me in the right direction?


Solution

  • The problem I had was with adding the dependencies to the projects.

    For c# one need to open the thrift solution, then select "Release" under build configurations and build it. Then under bin/Release you find the .dll file you need to reference in your project.

    For java you need to add the whole org folder to your project and then you need to add the httpclient-version.jar and httpcore-version.jar to the build path