I’m working with a poorly-engineered API. I have a class that I need to serialize, and I have control over the makeup of the class, but not the types that make up the properties the class is serialzing. An example is below:
<Project>
<SomeProperty1 />
<Install>
<DefaultStep></DefaultStep>
</Install>
<Uninstall>
<DefaultStep></DefaultStep>
</Uninstall>
</Project>
The problem is, I have no control over the “Install” and “Uninstall” types, and their nested types have the same name. "Install" resides in MyCompany.Install.dll, and "Uninstall" resides in MyCompany.Uninstall.dll. But the kicker is, MyCompany.Uninstall.dll refererences MyCompany.Install.dll, which is completely pointless. I know this is bad design (the whole Framework I’m dealing with is terrible) but I don’t have a choice in working with it.
The error I get is:
"Types 'MyCompany.Install.Uninstall.DefaultStep' and 'MyCompany.Install.DefaultStep' both use the XML type name, 'DefaultStep', from namespace ''. Use XML attributes to specify a unique XML name and/or namespace for the type."
That would be a nice idea, except I have zero control over the assemblies that contain the "Install" and "Uninstall" classes.
Any ideas?