I am currently trying to setup code analysis for a legacy WPF application. As part of this I am running FxCop 10.0 but I'm receiving errors for some of my DLLs, all of which build successfully.
The error that I'm getting is:
When I get this it is usually on a get
or set
property, there doesn't seem to be anything obvious as to why this is happening. I can't seem to be able to recreate this in a sample application. An example of a section of code causing this error within a set is:
Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
{
OnPropertyChanged("MyProperty");
}));
In the above code, if I remove the Dispatcher code FxCop successfully analyses the code, however leaving it in causes an error to be thrown. There are other instances of similar code working fine. Does anyone have any idea as to what could be causing this error?