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 assemblies, so they can be used by other non wcf projects etc. When updating refrences in the visual studio gui, this all works out just fine. As long as a type is found on both sides of the border, it's excluded from beeing defined in the proxy.
How can I achieve the same thing using svcutil?
More clearly I want to generate the proxy from a dll, not a running service which contains the servicecontract. At the same time I want to feed the dll files containing the shared types, which should be excluded from beeing defined in the proxy.
The reason for all this is for allowing my projects to be updated and built on a buildserver.
Edit:
First of thank you for your reply and suggestion of parameters. However I'm not getting svcutil reusing the assemblies following your instructions.
Here is parts of the .bat file I made I've excluded all the flags for generating INotifyPropertyChanged etc.
SET BACKENDROOT=C:SomePathDevelopmentBackendin
SET DATAMODELSBASE=C:SomePathDevelopmentDataModelsin
SET COMMONBASE=C:SomePathDevelopmentCommonin
SET REFRENCED_ASSEMBLIES=/r:%DATAMODELSBASE%Jall.DataModels.Consignment.dll
svcutil %BACKENDROOT%Jall.Backend.Consignment.DLL /t:metadata
svcutil /o:test.cs %REFRENCED_ASSEMBLIES% *.wsdl *.xsd
The result is as follows:
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/KSD.DataModels.Consignment")]
public partial class ExtInvoice : OrmBase
{
private System.DateTime buyersOrderDateField;
private bool buyersOrderDateFieldSpecified;
private string buyersOrderNumberField;
private string compCodeField;
.....
And in the client it self:
public Address CreateNewAddress(int TK, string AddressType)
This is incorrect the datamodels are generated directly in the proxy. The client doesn't just skip them and use the proper namespace for the types. The correct result should be:
public Jall.DataModels.Consignment.Address CreateNewAddress(int TK, string AddressType)
(Names are scrambeled :) )
Brgds,
Stian
See Question&Answers more detail:
os