protoactor-dotnet icon indicating copy to clipboard operation
protoactor-dotnet copied to clipboard

Include Protos.proto in nuget again - or how to reference actor.PID in proto message?

Open nibdev opened this issue 1 year ago • 2 comments

In the current version of the nuget the Protos.proto file is not included anymore. If one wants to send a PID over a proto message it's not possible (or i dont know how??). In the chat example the Protos.proto file from the .git source code is referenced, but this is not possible when using the nuget.

Is there any easy way?

Currently i define my own PID class (for messages) and a C# extensions method to convert between these two

nibdev avatar Mar 16 '23 12:03 nibdev

If anyone want to give this a go, feel free to grab this task. If you can make it so that the protos.proto file in the main proto.actor project is included in the nuget reference, as a file which gets added to the project referencing proto.actor, this would be fantastic.

I know it is possible as others include readme files and similar things. I just don't know how to myself

rogeralsing avatar Apr 14 '23 18:04 rogeralsing

I make a sample for including the proto files to nuget package and import it in the chat example instead of local reference https://github.com/asynkron/protoactor-dotnet/commit/c4b9b49bb6e93b7093c45d9105d7b1976acd10ea

It's not auto-generated, require adding GeneratePathProperty="true" property to nuget reference and adding the proto path to imports AdditionalImportDirs=".; $(PkgProto_Actor)\Protos"

I suggest collecting all proto files in single nuget without using Protobuf code generation and reuse this package in different packages.

so user could just import single package instead of the need for multiple AdditionalImportDirs

@rogeralsing If you find this is a good solution, I could start working on it.

Reference: https://www.asystad.net/sharing-message-types-between-grpc-services-in-net/

mseada94 avatar May 06 '23 20:05 mseada94