I'm following instructions to add a service reference to my project and, by default, the "reuse types in referenced assemblies" is ticked.
If I leave it ticked, I get ambiguous warnings on controls like Label, which I have to declare fully now.
If I untick it, the warnings go away.
My questions are:
Why would I want to reuse types?
What does that mean exactly?
What are the problems if I don't use it?
It means that, if you control both the server code and client code and define the datacontract classes in a separate assembly (and add a reference to it in the client code), the svcutil will not generate new classes but instead will re-use your already-defined classes that you use for the server.
Applies to: Visual Studio Visual Studio for Mac Visual Studio Code. For . NET Framework projects, service reference enables a project to access one or more WCF Data Services.
I know I'm answering like two years late, but...
- Why would I want to reuse types?
To avoid having two classes with the same name, types, etc.
- What does that mean exactly?
It means that, if you control both the server code and client code and define the datacontract classes in a separate assembly (and add a reference to it in the client code), the svcutil will not generate new classes but instead will re-use your already-defined classes that you use for the server.
- What are the problems if I don't use it?
Generally none if you 1) do not control the server code or 2) specify full namespaces for everything. You may get ambiguous warnings if you're in the same solution for server and client code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With