c# – Is it possible to stop Resharper from offering to import specific namespaces?


I love how Resharper offers to import namespaces when I put in code from them.

enter image description here

But for this particular, namespace (“OpenCvSharp”), I actually want to prevent it from being imported because doing so starts to cause ambiguities in the names of identically-named types from other namespaces.

At the top of my file I just give this namespace a short alias to make typing easier. I want all code in the file to use this instead.

using Cv = OpenCvSharp;
using Cv2 = OpenCvSharp.Cv2;

Unfortunately this does not stop Resharper from popping up that little suggestion thing. It is so easy to accidentally agree to it and then I have to undo the change.

I love the suggestion feature and I don’t want to turn it off except for this namespace. Is there any way to tell it to not suggest importing from this particular namespace while still having it do so for others?

Leave a Reply

Your email address will not be published. Required fields are marked *