by Mikael Henriksson
23. October 2009 20:22
A long time ago I participated in one of these old forum discussions about where to put interfaces. Some people argued that their interfaces went in a subfolder called interfaces. This whole discussion was part of a longer inversion of control discussion. Me myself and Irene thinks that the interfaces should go hand in hand with the default implementations. When I end up with too many interfaces I like to tuck them away in a subfolder but that makes Resharper complain about the namespace is out of sync with the location. I won’t under any circumstances move the interface to an interface namespace location because that is just bad practice IMHO. It should be with the default implementation but you can still have it in a different folder.
All you need to do is right click on the interface folder and select properties:

Here is a setting called Namespace Provider:

Now R# will stop complaining. :)
PS. Don’t ever under any circumstances name a class the same thing as the namespace it is located in…. it can cause some seriously slow build times!
DS.