Alex Farber

I have WCF server project which references Definitions library. Definitions library contains class Types with some enumerations:

namespace Definitions
{
public class Types
{
public enum InputData
{

...
}

}
}

Definitions.Types is used and part of service communication protocol:

[OperationContract]
void DoSomething(Types.InputData data);

When I generate client classes using svcutil, this enumeration is duplicated in generated files and called Definitions.TypesInputData.

I would like to reference Definitions project from WCF client, and use original InputData type instead of generated type. How can I do this

For example, svcutil doesn't generate any .NET types which are used in [OperationContract] functions. These types are directly referenced both by service and client projects. I need the same behavior for my own types.



Re: Windows Communication Foundation (Indigo) Using my own types in WCF communication protocol

Brian McNamara - MSFT

See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1033455&SiteID=1

Short answer, try

svcutil /reference:AssemblyWithTypes.dll






Re: Windows Communication Foundation (Indigo) Using my own types in WCF communication protocol

Alex Farber

Thank you, this is exactly what I need.