I added two custom classes to my project, namely “AutoSizeGrid” and “AutoSizeGridEditable”
Both derive from DataGridView, but that’s probably neither here nor there.
But where they are is seemingly somewhat of a conundrum.
My project builds and runs fine; however, when inspecting it with Resharper, it gives me a “Constraints Violation” for both of these, saying: “Namespace does not correspond to file location, should be: ”
Do I need to change them like so, from, e.g.:
class AutoSizeGrid : DataGridView
…to:
class <Name of my Solution>.AutoSizeGrid : DataGridView
?
I’d rather not, as I don’t know if this would force me to delete the prior DGV-derived components from my forms and replace them with the recompiled versions; that would be a pain in the donkey.
As ElVieejo says, it is not necessary to change it if the code compiles. ReSharper (and other code quality tools) recommend you keep namespaces in sync with file paths because that is the Microsoft convention. Namespaces are extremely helpful for keeping code organized, especially as projects/applications get larger, so it’s good to have some clear rules and follow them, but they are for readability and separation of concerns, not syntactical correctness.