Apache Thrift netstd

Thrift client library for Microsoft .NET Standard

Build the library

How to build on Windows

How to build on Unix/Linux

Known issues

Migration to netstd

... from netcore

If you are migrating your code from netcore library, you will have to:

You may wonder why we changed so many names. The naming scheme has been revised for two reasons: First, we want to get back the established, well-known naming consistency across the Thrift libraries which the netcore library did not fully respect. Second, by achieving that first objective, we get the additional benefit of making migration at least a bit easier for C# projects.

... from csharp

Because of the different environment requirements, migration from C# takes slightly more efforts. While the code changes related to Thrift itself are moderate, you may need to upgrade certain dependencies, components or even modules to more recent versions.

  1. Client and server applications must use at least framework 4.6.1, any version below will not work.
  2. Switch to thrift -gen netstd. The following compiler flags are no longer needed or supported: hashcode and async are now standard, while nullable is no longer supported.
  3. Familiarize yourself with the async/await model, if you have not already done so. As netstd does not support ISync anymore, async is mandatory. The synchronous model is simply no longer available (that's also the reason why we don't need the async flag anymore).
  4. Consider proper use of cancellationToken parameters. They are optional but may be quite helpful.
  5. As you probably already guessed, there are a few names that have been changed:
  6. add using Thrift.Processor; in the server code where appropriate
  7. the TServerSocket is now called TServerSocketTransport
  8. change IProtocolFactory into ITProtocolFactory
  9. if you are looking for TSimpleServer, try TSimpleAsyncServer instead
  10. similarly, the TThreadPoolServer is now a TThreadPoolAsyncServer
  11. the server's Serve() method does now ServeAsync()
  12. In case you are using Thrift server event handlers: the SetEventHandler method now starts with an uppercase letter
  13. and you will also have to revise the method names of all TServerEventHandler descendants you have in your code