aw04
aw04

Reputation: 11187

Multiple WCF Service References

I have a WCF service that is being referenced in two projects that interact with each other. I have a class defined in my service that needs to be used in both projects but because of the different namespaces they are not recognized as the same class. For instance, in one class it would be project1.myservicereference.myclass and in another project2.myservicereference.myclass.

I don't have a lot of experience with WCF and wanted to know how others deal with this situation?

Upvotes: 0

Views: 640

Answers (2)

Chevul Ervin
Chevul Ervin

Reputation: 883

Put the service reference in its own project and reference that project in all the other projects that need to access that service.

Upvotes: 2

Tallek
Tallek

Reputation: 1575

You should be able to put your class in a common assembly and share that type between you server and clients. Take a look at this: http://blog.walteralmeida.com/2010/08/wcf-tips-and-tricks-share-types-between-server-and-client.html

Upvotes: 2

Related Questions