svcutil exlude/reuse refrenced assemblies

后端 未结 3 1768
Happy的楠姐
Happy的楠姐 2020-12-16 06:55

Is it possible to use svcutil to reuse/exclude referenced types, as with visual studio.

I have multiple projects, my types/datamodels are stored in separate assembli

3条回答
  •  無奈伤痛
    2020-12-16 07:37

    If you run svcutil without arguments, you'll see it has several functions. I think you could do what you want with two invocations:

    • One to generate metadata from your binary, with a command line like svcutil /serviceName: . This outputs .wsdl and .xsd files.
    • Another to generate code from the metadata, with switches specifying where to find existing types for the data contracts: svcutil /reference: *.wsdl *.xsd.

    I've tried doing this in one step before, but when svcutil is in "code generation" mode, it expects metadata as input, not assemblies. So generate metadata first!

提交回复
热议问题