- Open https://protogen.marcgravell.com/ online code generator which is from protobuf-net.
- Paste the latest contents of the
gtfs-realtime.proto
file. - Generate C# code using default options.
- Paste the generated code right after the license header in the
GtfsRealtime.cs
file. - Update version number and release notes in Visual Studio project properties.
- You'll need a file
protogen.exe
, which is from protobuf-net. You can download theprotogen.exe
file from protogen.marcgravell.com (for example, https://protogen.marcgravell.com/protogen/protogen%202.3.16.zip). When you extract the zip the exe will be in thenet462
folder. - Add the path to
net462
folder containingprotogen.exe
to your Windows Path (it must be executed from a directory that contains the other .dll files).
-
From the root folder, run:
protogen.exe gtfs-realtime.proto --csharp_out=dotnet/GtfsRealtimeBindings/ cd dotnet/GtfsRealtimeBindings/ del GtfsRealtime.cs rename gtfs-realtime.cs GtfsRealtime.cs git add -- GtfsRealtime.cs
-
Add the license header back to the generated source file.
-
Update version number and release notes in Visual Studio project properties.
-
Download and install Visual Studio - the free "Community" version is fine.
-
Download and install NuGet CLI.
-
Create an API key and configure NuGet using your authorized account for gtfs-realtime-bindings as discussed here.
-
Start the "Developer Command Prompt for VS 2022" in the root project directory.
-
Rebuild the solution for
Release
:msbuild dotnet\GtfsRealtimeBindings.sln /p:Configuration=Release
-
Run the unit test to make sure you didn't break anything:
vstest.console dotnet\GtfsRealtimeBindingsTest\bin\Release\GtfsRealtimeBindingsTest.dll
-
Set API key, build and deploy the package to NuGet.
nuget setApiKey xxxxxxx
nuget pack GtfsRealtimeBindings/GtfsRealtimeBindings.csproj -Prop Configuration=Release
nuget push GtfsRealtimeBindings/bin/Release/GtfsRealtimeBindings.X.Y.Z.nupkg -Source https://api.nuget.org/v3/index.json