function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Christopher ArrandaleChristopher Arrandale 

Attribute cannot be applied multiple times

Hello. I'm sorry if this is a silly question. I'm using VB .Net WPF and I'm trying to use the Enterprise SOAP API. I'm using this guide: https://developer.salesforce.com/docs/atlas.en-us.224.0.api.meta/api/sforce_api_quickstart_steps_import_wsdl.htm

I'm getting some errors in the autogenerated class. I know that there is a bug but I'm not fully understanding what that fix is for if it applies here. If you need any more information please let me know. Thank you!
Severity	Code	Description	Project	File	Line	Suppression State
Error	BC30663	Attribute 'GeneratedCodeAttribute' cannot be applied multiple times.
Error	BC30663	Attribute 'SerializableAttribute' cannot be applied multiple times.
Error	BC30663	Attribute 'DebuggerStepThroughAttribute' cannot be applied multiple times.
Error	BC30663	Attribute 'DesignerCategoryAttribute' cannot be applied multiple times.
Error	BC30663	Attribute 'XmlTypeAttribute' cannot be applied multiple times.
Warning		Custom tool warning: Schema could not be validated. Class generation may fail or may produce incorrect results
Warning		Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.	
Warning		Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.


 
AnudeepAnudeep (Salesforce Developers) 
A similar error is discussed here. I suggest taking a look
mfawcettmfawcett
That link did not help since it is a different issue. I am having the same errors. Did you find a solution.
Christopher ArrandaleChristopher Arrandale
No I didn't. My project has been on hold after many hours of playing with it.
mfawcettmfawcett
Thanks. I already have my project working with an old WSDL but I added a new field and had to export the file again. After adding the new WSDL file I am geeting those errors. I created a case in Salesforce so will see if they can provide any solution. Keep you posted.
mfawcettmfawcett
Hello Christopher,

I cannot guarantee that this is the perfect solution but I edited the reference.vb file (Visual Studio 2019 Visual Basic)  and deleted the rows that were causing the errors. Under the errors window double click on the error line and it will open the reference.vb file, hightlight the rows and press delete (from <...>)
User-added image

I had an aditional error "Targetfiled is already declared as 'Private TargetField....'  I went to the line and rename the property as TargetField1 
User-added image
I rebuilt the solution and it is working as expected. Anyway I will let you know if I get any update from Salesforce.