Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Thrift to connect to Cassandra from .NET

I'm interested in Cassandra and I'd like to test it at home in my Windows XP computer. I've found instructions for install an run Cassandra in Windows, and it's already up and running; I've also found the thrift executable for Windows and generate the C# interfaces, but... when I try to compile that generated code in Visual Studio I got : "The type or namespace name 'Thrift' could not be found (are you missing a using directive or an assembly reference?)", so I'm missing something else, but I cannot find what... What is it? Is it a dll? I've looked in the thrift code and I cannot find anything related to .net , so what am I missing?

Thanks in advance.

Regards.

like image 999
vtortola Avatar asked May 09 '10 17:05

vtortola


1 Answers

From Thrift Wiki:

The C# code generated by Thrift uses the Thrift namespace. To be able to use the code generated by Thrift you need to reference Thrift.dll in your project to gain access to the Thrift namespace. This is required for the Thrift generated C# code to compile.

So you simply need to add a reference to Thrift.dll to your project. The wiki page contains instructions how to build Thrift.dll from source if necessary.

like image 80
dtb Avatar answered Sep 18 '22 17:09

dtb