Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .Net Core bindings #56

Open
jsiedentop opened this issue Feb 19, 2020 · 6 comments
Open

Add .Net Core bindings #56

jsiedentop opened this issue Feb 19, 2020 · 6 comments

Comments

@jsiedentop
Copy link

.Net Framework is supported, but there is no binding for .Net Core. It would be great, if you ship the NuGet Package as a .Net Standard package, so it can be used on any platform.

@barbeau
Copy link
Member

barbeau commented Feb 19, 2020

@jsiedentop Here's our current process for generating the .NET bindings:
https://github.com/MobilityData/gtfs-realtime-bindings/blob/master/dotnet/UPDATING.md

It uses a 3rd party library for generating the bindings.

It looks like there is an official C# generator, though, that we could use:
https://github.com/protocolbuffers/protobuf/tree/master/csharp
EDIT We can't use this, it's only for proto3 files.

I think that would address your need? Or is there a simpler way to generate the package you're looking for using the existing process but different command-line parameters for build/release?

I'm not a .NET developer, so community feedback on this issue would be great.

@jsiedentop
Copy link
Author

@barbeau Thanks for the reply.
In C# you can decide to develop with the .Net Framewok (the "old framework") or with .Net Core (the "new framework"). It is not possible to load an assemply, developed in the one framework, from a project developed in the other framework. For that reason there is a subset of both frameworks, the .Net Standard. If MobilityData would publish the implementation with .Net Standard, it would be possible to use the NuGet Package in both Frameworks.

the big drawback from the .Net Framework is, that it is not platform independent. So, it runs only on Windows. With .Net Core it's possible to run on any platform.

@barbeau
Copy link
Member

barbeau commented Feb 21, 2020

@jsiedentop I'm certainly in favor of publishing the bindings in a way that's available on the most platforms. The problem is that we have to use existing tools to generate the bindings, so we're limited based on what those tools can do. And unfortunately, looking at https://github.com/protocolbuffers/protobuf/tree/master/csharp again, it only supports proto3 files, and GTFS-realtime is proto2. So we can't use Google's official protocol buffer compiler - that's why we're using a 3rd party compiler:
https://github.com/protobuf-net/protobuf-net

If you can take a look at the 3rd party compiler and our existing documentation for updating the .NET bindings and suggest specific changes to the process to accomplish publishing the bindings with .NET Standard, I'm certainly open to looking at it. Pull requests welcome!

@JoeSchulte
Copy link

You can also multi-target NuGet packages to Standard, Framework, and Core.

@allister-grange
Copy link

allister-grange commented Jun 15, 2023

@barbeau it looks like in the repo you linked that proto2 is now supported. Will there be an update to this repo to allow .Net core?

@jameslinjl
Copy link
Contributor

@allister-grange I'm hoping to take a look at updating this part of the repo in the next couple weeks / months (as I have time)! I'm the most active contributor here for now (Sean hasn't been active here for some time).

That being said, contributions are also definitely welcome if you have open cycles! The golang and python bindings have the most up-to-date patterns to follow right now, if you want to give them a shot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants