Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to reuse all assembly types in svcutil and specify a dictionary collection type?
    primarykey
    data
    text
    <p>I am trying to generate my solution's Service Reference through the command line, so I've been trying to do it with svcutil. I have two problems.</p> <ol> <li><p>In Visual Studio 2012, I can specify a collection type of System.Array and a dictionary collection type of System.Collections.Generic.Dictionary. In svcutil, there is only an option for collectionType, how can I specify both collection types?</p></li> <li><p>In Visual Studio 2012, I can choose to reuse types in referenced assemblies. I can then pick to Reuse types in all referenced assemblies. Is there a way to instruct svcutil to reuse all types from a solution, or even a way for me to list multiple assemblies from which to re-use types from?</p></li> </ol> <p>Extra details: My project is a silverlight one. I have many assemblies, and I'm not sure what types are reused and where. Dictionary types are converted to Dictionary, and all other collection type are converted to System.Array.</p> <p>Here is my current attempt at reproducing my Reference.cs file using the command line instead of Visual Studio 2012:</p> <pre><code>SvcUtil.exe /target:code "myMexServiceAddress" /language:cs /out:Reference.cs /noConfig /async /collectionType:System.Array /serializable /serializer:Auto /enableDataBinding /namespace:*,myNamespace </code></pre> <p><em>EDIT: I am currently successfully generating my service references through Visual Studio 2012, but I need to be able to generate them through command line. This is where I fail to do so.</em></p> <p><strong>UPDATE1:</strong> So I solved issue 2. You simply need to add /r:assembly.dll /r:assembly2.dll /r:assembly3.dll to the svcutil to have it reuse types in those assemblies. It's a bit annoying to have to manually add the path to all assemblies you want, but there is no way to have it automatically use all types from your project references like in Visual Studio.</p> <p><strong>UPDATE2:</strong> To generate Silverlight 5 service references and Portable Library service reference in code you need to use SLSvcUtil.exe instead of SvcUtil.exe as such:</p> <pre><code>SLSvcUtil.exe "myMexServiceAddress" /out:Reference.cs /language:cs /enableDataBinding /namespace:*,myNamespace /serializer:Auto /config:ServiceReference.config </code></pre> <p>I still do not know how you can specify two types of collections, one for Dictionaries and one for other collection types. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload