Friday, 9 August 2013

Fody PropertyChanged interfering with FxCop

Fody PropertyChanged interfering with FxCop

I am currently working on a project where we would like to use the Fody
PropertyChanged IL weaver. It appears to work fantastically, but it is
doing strange things to our FxCop analysis built into visual studio.
We have CA1062 and CA2214 enabled: The former validates arguments of
public methods and the latter checks for calls to overridable methods in
constructors.
The second one, we have figured out is due to the fact that we are also
using Caliburn.Micro which supplies a method called
NotifyOfPropertyChanged which is virtual. This is a simple fix of changing
the method to not be virtual.
The first issue is much harder and seemingly random. We have been hard
core about validating our arguments from the get go and did not have any
FxCop analysis errors before Fody, but when I added it through NuGet FxCop
was seeing changes in places that shouldn't have any weaved code for
property changed. I even looked at a diff of the de-compiled source before
and after Fody, and there are FxCop conflicts in places where methods
weren't changed at all.
So my question is whether I can somehow postpone Fody weaving till after
the analysis is finished, or if there is some other way to get Fody and
FxCop to interact nicely ?
Thanks in advance

No comments:

Post a Comment