CA2109 - ignore or not ignore - that is the question
In a program I am writing with a friend we get this warning: CA2109. After looking at the MSDN I was quite puzzled if this is something I need to be concern about or not.
MSDN VS2008: http://msdn.microsoft.com/en-us/library/ms182312(v=VS.90).aspx
MSDN VS2010: http://m开发者_开发知识库sdn.microsoft.com/en-us/library/ms182312.aspx
The difference between these 2 versions is this section that is taken from the VS2008 MSDN but doesn't exist in the VS2010 MSDN:
Note This rule only applies to versions of the before .NET Framework version 2.0. You can suppress this warning in .NET Framework version 2.0 and all later versions. In these later versions, the runtime automatically makes sure that the creator of the delegate is in the callstack during a stack walk for a security demand.
Any suggestions?
EDIT: Just to clarify after reading DGH answer - As described in the note in MSDN2008 I can ignore it because the compiler is dealing with this. My question is what is going on in VS2010 where this note doesn't exist.
It is a potential security concern. If the code still compiles and runs (which warnings shouldn't prevent), then you certainly can ignore it an move on. However, if you wish to have the highest possible level of security for your program, you should probably consider addressing this issue as recommended by those MSDN articles.
精彩评论