Search code examples
c#idlgrpcbond

Bond Communications Framework Deprecated


I´ve used the bond-compiler gbc to create some object and a service definition for me:

namespace Something;
struct SomeStruct
{
    0: string SomeName;
}
struct SomeResponse
{
    0: string ResponseString;
}
service SomeService
{
    SomeResponse DoSomething(SomeStruct);
}

The compiler generated a class definition Something_services.cs with this Signature:

[System.CodeDom.Compiler.GeneratedCode("gbc", "0.8.0.0")]
public abstract class SomeServiceServiceBase : ISomeService, global::Bond.Comm.IService

I was wondering about the IService Interface and wanted to know more about this and came to the Bond Communications Framework Doku (https://microsoft.github.io/bond/manual/bond_comm.html). The first thing to read was, that Bond.Comm is deprecated and you should use Bond-over-gRPC (https://microsoft.github.io/bond/manual/bond_over_grpc.html) instead.

I have two questions:

  • Does someone know, why this is depracted but by default still used by the compiler?
  • Is there someone who can explain the difference between Bond.Comm and Bond-over-gRPC?

Thanks in advance!

EDIT

And a third question occured: How to use the --grpc-flag mentioned in the documentation?


Solution

  • The Bond C# gRPC bindings first shipped in Bond C# 5.3.0, which was released on 2017-04-14. You will need to upgrade all your Bond NuGet packages to 5.3.0 to start using it.

    You are seeing the compiler generate the Comm files by default because you're using a version earlier than 5.3.0.

    As noted in the changelog for the 5.3.0 release (and the Bond Comm 0.11.0 release), Bond Comm files are no longer generated by default for C#. To keep using Bond Comm C#, you'll need to start passing --comm to gbc. There's an example that shows what change is needed.

    If you want to start using the C# gRPC bindings, you'll need to pass the --grpc option. The gRPC example shows how to do this as well.