Im working on a Web-Application (MyWebApp). I have a Service-Reference to a WCF-Webservice. The Servicereference is named “MyService”. If I use Types from the Service I use them like “MyService.MyType”.
Now however I want to outsource some helper-methods to an assembly (MyAssembly). To do this I created a DLL-Project, added the Service-Reference “MyService” and referenced the compiled assembly to my Web-Application.
Now if I want to pass an Object of type “MyType” to an outsourced function that expects “MyType” it says “Argument 1: cannot convert from ‘MyWebApp.MyService.MyType‘ to ‘MyAssembly.MyService.MyType‘”
How can I fix this? It’s the same service, so it must be a identifier-problem.
Remove the service reference from MyWebApp.Since you have two service reference in both of projects, they are generating the same classes under different namespaces.