FxCop rule CA2227 and setter error using linq to sql

6. October 2009

I was having a problem with this fxcop rule today CA2227.  This error was being thrown out on all the  Associations when using the Linq to sql templates here: http://l2st4.codeplex.com/

Well of course we cannot have that as this violates checkin policy, so what I did was add this line here to the template:

 [GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]

I googled this problem and landed on Andre Loker's blog here.  I understood the problem as he prensented it, but umm Microsoft is doing this..Yes.

So I dug deeper..and came here:  

Yes, it is a problem, but the workaround is against our policy, so onward...bound to here

Great justification and it fit my needs.  Yes there is some evil when using code generations, but I like having more control and the linq to sql T4 templates give me that.

Hope this helps someone else.

.Net , C#

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading