在Visual Studio中使用Thrift和Apache.Casandra

本文关键字:Thrift Apache Casandra Visual Studio | 更新日期: 2023-09-27 18:20:48

我想使用"Thrift"answers"Apache.Casandra"资源从C#(使用Visual Studio IDE)连接到Cassandra(已经在localhost上运行)。

第一个问题是…我应该使用像"cassandra sharp"这样的客户还是前面提到的资源?我找到了一个例子(http://www.ridgway.co.za/archive/2009/11/06/net-developers-guide-to-getting-started-with-cassandra.aspx)使用这些资源,对我来说似乎很容易。

第二个(愚蠢的)问题是:我如何才能在Visual Studio中获得外部资源?我安装了NuGet,下载了Thrift(仍在寻找"Apache.Casandra"),现在它被放在"References"目录中,我在声明中写了"using Thrift.Protocol"等。。。但当我尝试调试时,我会遇到一些错误,比如:

"找不到类型或命名空间名称"TTransport"(是否缺少using指令或程序集引用?)"

谢谢大家的帮助,洛伦佐

在Visual Studio中使用Thrift和Apache.Casandra

首先获取C#的一个可用客户端,然后了解是否需要构建自己的客户端。

如果您决定构建自己的客户端(包括连接池),您需要从http://thrift.apache.org/download/Thrift C#库源代码(当前版本0.8)包含在您的项目中,msbuild任务或Thrift.exe编译器可从Cassandra.freet.构建C#Cassandra代理源代码/库