Disable Resharper "Configure Namespace" for specific files
I have a class with a namespace that doesn't match the project folder structure.
With // ReSharper disable once CheckNamespace
I can turn off the hint that the namespace does not match the file location. But when redesigning project namespaces, the class is still selected to customize the namespace.
Is there a way to disable changing the namespace?
Update with example:
In my case, I have a view class that needs to be in System.Web.Mvc
-Namespace. File location: [Root]> src> Views Default namespace of root projectCom.xxxxx.Commons.Web
So Resharper always wants to set the namespace to
Com.xxxxx.Commons.Web.Views
or Com.xxxxx.Commons.Web
if I turn off the namespace-provider flag for the Views folder.
source to share
The ReSharper Adjust Lames refactoring no longer affects the tagged namespaces // ReSharper disable CheckNamespace
. A long-standing bug in ReSharper (as referenced in @ulrichb's old answer) has been fixed as of ReSharper 2016.2.
Note that currently (ReSharper 2018.1) there is still an error in the UI where all files are still displayed in the Customize Namespace Name UI, but namespace changes do not actually take place. This is misleading, but ReSharper did fix the problem.
source to share