When performing Resharper clean operation, usings are removed that prevent ambiguous references

After a recent update, Resharper started to remove using statements in my c# code which were there to prevent an ambiguous reference error in Visual Studio.

For example, I have a class which uses both System.Windows and System.Windows.Forms.  In that class I have a method that creates a MessageBox object.  Since there is a System.Windows.MessageBox and a Systems.Windows.Forms.MessageBox, Visual Studio shows an error since this is an ambiguous reference.  In addition if I put the full path,  System.Windows.MessageBox, at the place where I'm using it, Resharper removes "System.Windows" saying it's redundant.  If I try to build the project, I can't because there are errors.

Resharper will stop removing these items if I uncheck "Optimize 'using' directives" from the Code Cleanup settings, but I'd like to leave that enabled since it does other things that I do want it to do.

Let me know if there's something I'm missing or if you need more information.


Please sign in to leave a comment.