.net - C# projects: objects cross-usage -
have 2 projects: myserver & myclient in 1 solution. want use object of message class in both projects (messageserver & messageclient respectively). added reference of client server project, cannot opposite because error "...would cause circular dependency". have
using testmyclient; namespace testmyserver { public class messageserver {
on server side , use in code = new xmlserializer(typeof(testmyclient.messageclient));
i want have same, on client side. sadly cannot input testmyserver
using
namespace , cannot reference messageserver
class...
how cross-use these classes ?
your question isn't clear - it's not obvious why you'd want have 2 different types @ - answer have one type in namespace both server , client projects refer to.
server client \ / \ / common
no circular dependencies, one shared type, everyone's happy.
if need 2 message types (one requests , 1 responses, example) define both messages in common project. advise don't call them messageserver
, messageclient
though - both messages used both server and client, 1 generate , other consume it. using terminology of request , response lot clearer.
Comments
Post a Comment