2008-10-10

DependencyProperties och FxCop - ett svar!

Har nu fått ett svar om mitt problem med att följa de guidelines som anges i FxCop när jag använder dependency properties i Workflow Foundation.

Hi Daniel,
Thanks for the feedback. We use FxCop internally on the WF framework, but unfortunately, we must have missed running it on our content (e.g. samples), otherwise we would have picked this up. We are hoping to address this in the next version of WF by making sure that the usage of our OM helps to promote proper .NET coding practice.
Instead of having to add suppressions everywhere in your code, the other option is to disable that particular rule from running. I realize this isn't a great solution, but I thought it may be a reasonable option for you.
Thanks again for reporting this issue.
-- Dave, WF Team

Låter som ett bra och ärligt svar och jag kan med gott samvete arbeta vidare :-)

Nu återstår bara frågan om jag skall designa, dvs med public static readonly eller utan readonly.. då varningen som jag får av fxcop utan readonly är "bara" Microsoft.Usage medan den med readonly är Microsoft.Security (DoNotDeclareReadOnlyMutableReferenceTypes).. trots detta borde readonly vara det mer korrekta sättet att deklarera en dependency property.

Inga kommentarer: