Did you know that svcutil with /r does not work for MessageContract

3 ביולי 2008

I was trying to generate WCF proxy (Client) using svcutil.exe Visual Studio 2008 version. I also need to use the /r parameter of the svcutil.exe, so the generated proxy code will not generate definition for the objetcs from my reference assemblies.
The command I use is something like:
svcutil.exe /async http://localhost:8080/MyService /r:"C:\My.dll" /tcv:Version35 /out:MyClient.cs

In case the assembly My.dll contain .NET object that mark as [MessageContract] the generated proxy still contain definition for the MessageContract objects, so I have to change these objects to DataContract objects and then the generated proxy was created as expected.

You also need to remember that if your reference objects (on My.dll) contain objects form other assembly, You have to include this assemblies also in your svcutil command. So you new command will look like:
svcutil.exe /async http://localhost:8080/MyService /r:"C:\My.dll" /r:"C:\MyOtherObjects.dll" /tcv:Version35 /out:MyClient.cs

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



  1. Dennis17 באוגוסט 2009 ב 17:43

    Hi Rotem,

    I have also an issue with the svcutil command line tool. My script used to work, with first generating a separate datacontract and later on a proxy without my classes. Somehow it isn't working anymore. All my classes are generated into my proxy. The generation of my separated datacontract is still working. This puts me in the situation where my classes are ambiguous. Do you have any idea beside the problem you described above why the generation of my proxy isn't working anymore. Thanks in advance.



  2. Rotem Bloom18 באוגוסט 2009 ב 8:41

    Hi Dennise,
    Thanks 4 your comment if you want my help I need to see your assemblies and the svcutil command you are using.
    You can contact me thru my personal mail (Use the Contact from my blog) and I will try to help.

    Thanks Rotem