Similar Namespace with WCF

I am a little confused about what rules I must follow. I found that the problem arises because the current application name is just “Common”, which is also the name of the company “Common”. I have a WCF service running and a link to a couple of class libraries with the following namespaces:

  • WCF Service: Common.Services
  • Application Domain Level: Common.Domain
  • Shared library: CompanyName.Common

With this name it compiles just fine, however, when I use the service with the WCF test client, it says that Company.Common does not contain Domain Do you miss the assembly link?

Company.Common really does not contain a nested Domain namespace. There is a separate Common.Domain , but it should not be nested like that ...?

If I use the service in another client (for example, a web application) that already refers to the CompanyName.Common namespace, it does not reuse this type because the namespaces are confused.

Using Visual Studio, I can look at two referenced assemblies on the client and show the correct structure. From what I can say, it just seems like WCF doesn't like namespaces.

I don’t think anyone else came across this?

+4
source share
1 answer

WCF has a number of problems when it comes to conflicting namespaces, and even classes, if they appear as different web service endpoints. For example, this will launch the service's Reference.cs file. In any case, the general good recommendation is to rename the namespace into something with a value, or break it into many more meaningful namespaces besides "Common".

+1
source

Source: https://habr.com/ru/post/1395843/


All Articles