I have:
namespace My.Namespace.Admin.Presenter
{
using System;
using System.Collections.Specialized;
using System.Globalization;
using My.Framework.Utility;
using My.Namespace.Core.Business.Admin;
using My.Namespace.Core.Entities.Admin;
...
}
In Visual Studio 2015, this is flagged as an improvement by the lightbulb IDE0001: Name Can by Simplified for
My.Framework.Utility
to Framework.Utility
My.Namespace.Core.Business.Admin
to Core.Business.Admin
My.Namespace.Core.Entities.Admin
to Core.Entities.Admin
I don't like the lighbulbs suggestion, how can I turn it off? There doesn't seem to be a global setting for these and clicking the IDE0001 error just performs a bing search rather than a dedicated help page.
This question deals with another issue flagged by IDE0001, but not the namespacing.
This can be achieved via creating a Code Analysis Ruleset
In project properties select the Code Analysis tab -
Then edit a ruleset. The IDE* rules are under the Analyzer Microsoft.CodeAnalysis.CSharp.Features
:
Change IDE0001 to none (or all of them to none), and the rule isn't fired anymore.
It's not granular enough to only get rid of the namespace IDE0001, but does get rid of it along with the rest of IDE0001 "suggestions" which is good enough for my needs.
The created Ruleset can be applied to all projects as needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With