Sometimes, I get this with a new project, when I add third-party assets:
The namespace '<global namespace>' already contains a definition for 'something or other'
You can see the problem on the right. Two vendors used the same class name, without adding a namespace.
Here’s their code:
As far as I can tell, this is just a careless error. The issue is well-known, and so is the solution: add your own namespaces.
There is no excuse for this. There could be mitigating factors I’m not aware of, but I don’t think so. If there are, please let me know in the comments.
I wrapped one of the classes:
namespace IgniteCoders { ... }
One of the assets only has one C# class, so it was the easier to fix.
Of course, if the asset is updated, the change will be lost, and I’ll have to do this again.
Annoying.