aliep
aliep

Reputation: 1802

'TProtocol' does not contain a definition for 'IncrementRecursionDepth'

I've installed thrift for both my library and server; using NuGet.

I have a very simple thrift file that I've compiled it using the following command:

thrift.exe -r --gen csharp node.thrift

the node.thrift has three lines:

service Server {
    string ping()
}

I get the errors from the Server.cs generated by the thrift compiler.

'TProtocol' does not contain a definition for 'IncrementRecursionDepth'

sample line throwing the error:

public void Read (TProtocol iprot)
    {
      iprot.IncrementRecursionDepth(); //this line has the error

I've googled for it, but didn't find any results.

update: If I delete the lines throwing the error, the library compiles and the server works as expected, I don't know if I'll face errors in the future or not, whats up with the recursion?!

important point: I compile the thrift file using the executable I've downloaded from http://www.apache.org/dyn/closer.cgi?path=/thrift/0.9.3/thrift-0.9.3.exe. the version is 0.9.3 but the thrift library installed by NuGet is 0.9.1.3

Upvotes: 4

Views: 1412

Answers (2)

aliep
aliep

Reputation: 1802

The Problem was that the compiler version was not equal to the thrift version installed by NuGet.

To install the latest official package from NuGet, search for ApacheThrift.

Upvotes: 2

JensG
JensG

Reputation: 13421

the version is 0.9.3 but the thrift library installed by NuGet is 0.9.1.3

Thats exactly the problem. The IncrementRecursionDepth() function has been added later to prevent a problem, which is outlined in more detail in THRIFT-3235. Since you need both compiler and library for it, you get a problem.

Solution: Always use matching compiler and libraries. In particular, use 0.9.3.

Upvotes: 7

Related Questions