This question is locked. New answers and comments are not allowed.
Problem:
JustCode gives a warning that a "Field MyTimer can be made readonly". However, the VB keywords WithEvents and ReadOnly cannot be used together. The auto-fix replaces the WithEvents keyword with the ReadOnly keyword. That isn't what I want. If I want to use WithEvents then I shouldn't get this warning. I don't know why VB won't let you use WithEvents and ReadOnly together, but it won't.
Reproduction Plan:
Declaration:
Private WithEvents MyTimer As ProcessSolutions.Timers.Timer
The MyTimer field is set in the constructor
Solutions:
Don't show the "can be readonly" fix if WithEvents is used.
or
Maybe have a quick fix that removes the WithEvents and Handles keywords and creates AddHandler statements in the constructor.
JustCode gives a warning that a "Field MyTimer can be made readonly". However, the VB keywords WithEvents and ReadOnly cannot be used together. The auto-fix replaces the WithEvents keyword with the ReadOnly keyword. That isn't what I want. If I want to use WithEvents then I shouldn't get this warning. I don't know why VB won't let you use WithEvents and ReadOnly together, but it won't.
Reproduction Plan:
Declaration:
Private WithEvents MyTimer As ProcessSolutions.Timers.Timer
The MyTimer field is set in the constructor
Solutions:
Don't show the "can be readonly" fix if WithEvents is used.
or
Maybe have a quick fix that removes the WithEvents and Handles keywords and creates AddHandler statements in the constructor.