![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | SVCUtil Reference and Duplicate Classes I am having issue with svcutil, references and the classes it generates. I have two service contracts that implement some of the same classes in their results that I want the proxy code to share. The source files it outputs no matter what I try keeps putting the same class in all of the files. For what it is worth, the class that is being placed in every proxy is based off of the Generic List. All of the other classes replicated across the contracts are filtered out. It is just this one class, in the same namespace as all of the other classes filtered. Here is the command: Svcutil /r: com.digitalbp.common.dll http://localhost:8083/UserService?wsdl This runs and output a UserService.cs class with this code inline (cut/paste): namespace com.digitalbp.common { using System.Runtime.Serialization; [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.CollectionDataContractAttribute(ItemName="Error")] public class ErrorCollection : System.Collections.Generic.List<com.digitalbp.common.Error> { } } There are a number of other classes defined in com.digitalbp.common that are not included. Namely as you see above the Error class. Any ideas? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: SVCUtil Reference and Duplicate Classes Thus wrote joe.osowski@gmail.com, > I am having issue with svcutil, references and the classes it > generates. I have two service contracts that implement some of the > same classes in their results that I want the proxy code to share. > The source files it outputs no matter what I try keeps putting the > same class in all of the files. > > For what it is worth, the class that is being placed in every proxy is > based off of the Generic List. All of the other classes replicated > across the contracts are filtered out. It is just this one class, in > the same namespace as all of the other classes filtered. [...] Do you need to use generated proxies at all? For type sharing scenarios, I'd rather go with ChannelFactory<T>. Cheers, -- Joerg Jooss news-reply@joergjooss.de |
My System Specs![]() |
| | #3 (permalink) |
| | Re: SVCUtil Reference and Duplicate Classes Thanks, but I don't believe that is relevant to the bug I am seeing. Be it a proxy or a ChannelFactory, I can't compile as the typed generic class is duplicated in multiple classes. Joerg Jooss wrote: > Thus wrote joe.osowski@gmail.com, > > > I am having issue with svcutil, references and the classes it > > generates. I have two service contracts that implement some of the > > same classes in their results that I want the proxy code to share. > > The source files it outputs no matter what I try keeps putting the > > same class in all of the files. > > > > For what it is worth, the class that is being placed in every proxy is > > based off of the Generic List. All of the other classes replicated > > across the contracts are filtered out. It is just this one class, in > > the same namespace as all of the other classes filtered. > [...] > > Do you need to use generated proxies at all? > > For type sharing scenarios, I'd rather go with ChannelFactory<T>. > > Cheers, > -- > Joerg Jooss > news-reply@joergjooss.de |
My System Specs![]() |
| | #4 (permalink) |
| | Re: SVCUtil Reference and Duplicate Classes Thus wrote joe.osowski@gmail.com, > Thanks, but I don't believe that is relevant to the bug I am seeing. > Be it a proxy or a ChannelFactory, I can't compile as the typed > generic > class is duplicated in multiple classes. You missed the type sharing part of my answer. There will be no generated code if you use ChannelFactory<T> *and* a shared contract assembly, if that's acceptable in your case. Cheers, -- Joerg Jooss news-reply@joergjooss.de |
My System Specs![]() |