Ask a Question

Ask a Question
Back to All

Microservice setup and custom return types

I have build errors when trying to make a standalone build, that make me think I may have set up my microservices incorrectly. I often create custom classes for return types of MS functions, that I declare within the MS class. Since the autogenerated MS client code needs to know that type, I added a reference to my MS in the autogenerated asmdef file. This works fine in the editor, but since MS projects are only defined in editor, my custom class doesn't get recognized when the autogenerated client builds for a standalone build, which leads to an error. Any idea what I'm doing wrong? I'd be happy to share some code if that helps clarify my problem. My custom return types are defined as sub-classes of my microservices, so not in Assets/Beamable/Common/ folder.

Some of those custom return types contain a field that's a storage object - one of the types I use to store data in a microstorage db. Those storage types need to be defined on the server side, so I'm not sure how I can share them between microservices and client code. I did manage to move my storage types into the Common project, but now this won't build in standalone, because "The type or namespace name 'ObjectId' could not be found (are you missing a using directive or an assembly reference?)". I did add MongoDb.Bson to Common's references, but is it possible this dll is only built for the editor?