I got a global enum referenced by two ServiceStack Web Api.
When I add those 2 services as client auto-generated code to the same project, the compiler is firing an error: “The namespace already contains a definition for this enum”.
It’s the same enum … ExcludeTypes does the trick :). The downside is that you have to do this for all duplicate types and it is not very user-friendly (every end user will have to add this manually [can you set default exclude types server side ?]).
We got all public DTO in one assembly (to ease sharing internally/externally, Nuget creation, global naming) but we have multiple service stack web API exposing them (MicroService architecture). Does this architecture (multiple services but all public DTO in one assembly) fit ServiceStack?
Sure, if you have all DTOs in the same assembly, you can just share that .dll with clients instead of using Add ServiceStack Reference. Note the client development experience is greatly improved if all Request DTOs are annotated with IReturn<T> and IReturnVoid interface markers.
Everything that should be in DTOs will be in ServiceStack.Interfaces.dll which should be the only .dll your DTOs should ever need to reference. If they ever need a reference to any additional .dlls you have a coupling issue which should be refactored so DTOs no longer have a direct dependency on them.