Closed sethsnel closed 2 months ago
It turns out that there were rules that removed files from obj/
from compilation. After commenting out these lines and reload the project the generated grpc client namespace could be found and and the client instantiated. I'm not sure how these lines ended up in my project file, I haven't added them consciously in any case. Answer can be resolved. Perhaps troubleshooting documentation could be expanded to check on obj/
folder.
Question
Having to manually include .cs files seems a no-op, and is also not mentioned by any tutorials or resources. How can I use the generated classes/clients from the .proto files without including generated client classes from the
obj/
folder?My situation and setup
I've verified wether I've followed the correct steps using these resources:
What I've setup:
On the server side
I've created a .proto file and derived a concrete implemantation. This implementation can find the generated
MijnSBBServices.MijnSBBServicesBase
inobj/Debug/net8.0/Protos/MijnsbbGrpc.cs
.On the client side
I've created the .proto file. A client cs file is generated in
obj/Debug/net8.0/Protos/MijnsbbGrpc.cs
. However, I'm not able to instantiate a client object unless I include these .cs files in my project.What have I tried and verified?
I've verified that I installed the correct Nuget packages for the client project:
I've verified that the project got the correct protobuff information in an itemgroup:
I've tried including the generated .cs files in the obj folder, as a result I'm able to instantiate a grpc client and even run/debug the setup:
However, this seems to be a no-op and is undesirable. (to manually include the generated files from the
obj/
folder). Please see question at top.