wcf icon indicating copy to clipboard operation
wcf copied to clipboard

Generated code won't compile if a property named "System" exists

Open SteSinger opened this issue 4 years ago • 1 comments

I have create a connected service from a wsdl provided by a customer. The generated code won't compile because the code contains a class with an object called System. This breaks the XmlElementAttribute since the compiler tries to use the property System instead of the namespace System.

grafik

Manually prefixing the namespace with global:: fixed the issue for now.

SteSinger avatar Mar 23 '20 12:03 SteSinger

Thanks for reporting this. In general naming a property System isn't a great idea because of conflicts like this, but we'll look into if we can add the global keyword to avoid this conflict in the generated code in a future release.

dasetser avatar Mar 24 '20 21:03 dasetser