views:

208

answers:

2

This happen after I installed the ReSharper. It's a problem that if I fix for one the other is going to alert and vice-versa.

private readonly System.ComponentModel.IContainer _components;

R# tries to add readonly if it does VC# gives this warnning(not error)

Warning 1 Field 'MFA.Visa.Form1._components' is never assigned to, and will always have its default value null C:\Users\Athiwat\Documents\Visual Studio 2008\Projects\Visa\WindowsFormsApplication1\Form1.Designer.cs 8 59 Visa

So how should I fix this?

+8  A: 

Ignore it, I don't bother with Resharper in designer files. Such files are pretty much the sole property of the designer that creates them.

KeeperOfTheSoul
+2  A: 

Resharper offers options, just alternatives. Following most of this alternatives you may acquire and get used to good practices. But this are alternatives, not commands. Sometimes you may even find that R# suggest you one thing, then you do that thing just to find that R# is now suggesting you the opposite. This is true with the explicit variable/implicit variable option, with the foreach/for option, with the if/switch option and a number of other constructions.

You can configure what you want to be suggested, ignore some of the options or use the R# comments to exclude some of them. What is more important to blindy follow all the R# suggestions is to know why it is suggesting something and then decide if you want to follow the suggestion or not.

JPMarichal