Excluding generic base type from proxy generation

We have some objects that have a base type (MyBaseType<T>) that we don't want to include. Is there a way to exclude this common base type from the proxy generation via svcutil I tried something to the effect of:

/excludeType:MyNamespace.MyBaseType`1

but that didn't have any affect.

Any ideas

Thanks,
Steve

-- contents of file to generate our proxies is below:

del *.xsd
del *.wsdl
"..\..\..\lib\winfx\svcutil" /r:../../../MyProject\bin\Debug\MyProject.dll ../../../MyProjectServices\bin\MyProjectServices.dll
"..\..\..\lib\winfx\svcutil" *.wsdl *.xsd /excludeType:MyProject.BaseEntity`1 /d:"../" /out:"Proxies" /rct:System.Collections.Generic.List`1



Answer this question

Excluding generic base type from proxy generation

  • niknaksbarbeque

    Without /et it includes the type, as expected.

  • Swatim

    Greetings --

    I'm sorry, I'm not exactly sure I understand the request.

    Could you include a code snippet of the code being generated and the code that you want to generate

    Thanks,

    -mike


  • tecxx

    So on the server side I have this:

    public class MyBusinessObjectBase<T> {}
    public class Customer : MyBusinessObjectBase<Customer> {}

    When I run svcutil on this I get MyBusinessObjectBaseCustomerZ0980Wewr generated as part of my proxies (the random characters I added do get added but I just made them up above ) I want to prevent the MyBusinessObjectBase<T> type from ever getting generated by svcutil.


  • Sammy1971

    Do you have the assembly containing MyBusinessObjectBase<T> Is this passed to svcutil /r

    /r allows one to provide an assembly and svcutil will not generate a type if it matches any type in the assembly. /excludeType allows one to exclude one or more types from the list of types in the /r assemblies



  • Roger Haight MSFT

    Anyone have any ideas if its possible to exclude a generic type from the proxy generation process using svcutil As noted in this thread I can't figure out to do it using /excludeType.

  • deanhully

    Did you try without /et

    Thanks



  • Sherif Mahmoud

    Yes I have the assembly containing MyBusinessObjectBase<T> and it is being passed to svcuitl /r

    How would I specify the fully qualified path to MyBusinessObjectBase<T> I've been trying something to the effect of:

    svcutil /r:BusinessLayer.dll /et:BusinessLayer.MyBusinessObjectBase`1 ServiceLayer.dll



  • Excluding generic base type from proxy generation