How to tell ReSharper not to add certain namespaces

Hi all,

If I have a class Account in the Product.Data.XX namespace and I'm currently working in the Product.Data.YY namespace I could either write var foo = new XX.Account() or add the Product.Data.XX namespace to the list and just write var foo = new Account().

It seems like in the current version of RS it automatically adds the Product.Data.XX to the using list. What I would like is for RS to either ask me if I want that namespace (Product.Data.XX) in the using list (I almost never do) or just automatically NOT add it to the list. In previous versions I believe it would ask you what you wanted. The new version tries to be too helpful. I saw in the options a way to always keep certain namespaces, but not a way to never add one.

So, is there a way for me to have var foo = new XX.Account() and keep it that way? Right now I have to constantly fight RS by going and fixing the changes it makes.

Thanks,
Peter

2 comments

Hello Peter,

What ReSHarper version do you use? Are you talking about 8.0 EAP or 7.1.3?
Also, do you have any other VS or R# plugins installed?

Thanks.

0

Hi,

I'm using the latest 7.xx version. Besides R# I have installed "Microsoft Web Developer Tools", "NuGet Package Manager", "NUnit Test Adapter", "Spell Checker", and "Visual Studio Extensions for Windows Library for Javascript". However, this behavior happens in the regular C# files, it's definitely a R# behavior; these extensions should not conflict.

Thanks,
Peter

0

Please sign in to leave a comment.