Error 1 Duplicate System Codedom Compiler Generatedcodeattribute Attribute
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up adding a service reference create duplicated definitions for enums and methods up vote 9 down vote favorite 4 I'm adding Navision Web Services to a simple Windows Forms Application using Add Service Reference functionality inside Visual Studio 2010, the reference are generated but inside the code there are duplicated definitions that stop the code from compiling, for example: Error The namespace 'WindowsFormsApplication1.ServiceReference1' already contains a definition for 'Status' C:\Trash\WindowsFormsApplication1\WindowsFormsApplication1\Service References\ServiceReference1\Reference.cs and inside Reference.cs I have [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1015")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:microsoft-dynamics-schemas/page/salesheaderpage")] public enum Status { ///
.NET Framework > Windows Communication Foundation, Serialization, and Networking Question 0 Sign in to vote I have a solution that includes several wcf services. Everything works great until I add a new service and include it in the wsdl generation. What happens is that several of my enumerations get listed http://stackoverflow.com/questions/20091836/adding-a-service-reference-create-duplicated-definitions-for-enums-and-methods twice, once as a System.Xml.Serialization.XmlTypeAttribute, and one as a System.Runtime.Serialization.DataContractAttribute. I've included a code example below showing one of my enum types behaving this way. I can't figure out the pattern of way this only happens when this new service is included, and why https://social.msdn.microsoft.com/Forums/vstudio/en-US/a1348c6a-83e3-4ea5-a2df-c4053d1b056b/svcutil-wsdl-creates-duplicate-types-in-the-proxy-file?forum=wcf only some of the enums are duped, and some are not. [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.3906.22")]
[System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/LR.Model.Enums")] public enum ReturnStatusEnum { ///resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine https://msdn.microsoft.com/en-us/library/66f800ya.aspx Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. C# C# Reference C# Compiler Errors C# Compiler Errors Compiler Error CS0579 Compiler Error CS0579 Compiler Error CS0579 Compiler Error CS0001 Compiler Error CS0006 error 1 Compiler Error CS0007 Compiler Error CS0015 Compiler Error CS0016 Compiler Error CS0019 Compiler Error CS0029 Compiler Error CS0034 Compiler Error CS0038 Compiler Error CS0039 Compiler Error CS0050 Compiler Error CS0051 Compiler Error CS0052 Compiler Error CS0071 Compiler Error CS0103 Compiler Error CS0106 Compiler Error CS0115 Compiler Error CS0116 Compiler Error CS0120 Compiler Error CS0122 error 1 duplicate Compiler Error CS0134 Compiler Error CS0151 Compiler Error CS0163 Compiler Error CS0165 Compiler Error CS0173 Compiler Error CS0178 Compiler Error CS0188 Compiler Error CS0201 Compiler Error CS0229 Compiler Error CS0233 Compiler Error CS0234 Compiler Error CS0246 Compiler Error CS0260 Compiler Error CS0266 Compiler Error CS0269 Compiler Error CS0270 Compiler Error CS0304 Compiler Error CS0310 Compiler Error CS0311 Compiler Error CS0413 Compiler Error CS0417 Compiler Error CS0433 Compiler Error CS0445 Compiler Error CS0446 Compiler Error CS0504 Compiler Error CS0507 Compiler Error CS0518 Compiler Error CS0523 Compiler Error CS0545 Compiler Error CS0552 Compiler Error CS0563 Compiler Error CS0570 Compiler Error CS0571 Compiler Error CS0579 Compiler Error CS0592 Compiler Error CS0616 Compiler Error CS0650 Compiler Error CS0686 Compiler Error CS0702 Compiler Error CS0703 Compiler Error CS0731 Compiler Error CS0826 Compiler Error CS0834 Compiler Error CS0840 Compiler Error CS0843 Compiler Error CS0845 Compiler Error CS1001 Compiler Error CS1009 Compiler Error CS1018 Compiler Error CS1019 Compiler Error CS1026 Compiler Error CS1029 Compiler Error CS106