I suggest that calling Invoke on an IMethod directly, without using With( InvokerOptions ) should report a diagnostic warning. This is in the spirit of more modern C# globalization warnings such as CA1307 ("Specify StringComparison for clarity"). Direct calls without using With have the default context-dependent behaviour which may not be the developer's intent. Using With makes the developer's intent clear. The warning could be suppressed if desired, or indeed it could be severity None by default, increased to Warning according to user preference.
Hello @tg73, thank you for submitting this issue. We will try to get back to you as soon as possible.
Note to the PostSharp team, this ticket is being tracked in our dashboard under ID TP-33796.
I suggest that calling
Invoke
on anIMethod
directly, without usingWith( InvokerOptions )
should report a diagnostic warning. This is in the spirit of more modern C# globalization warnings such as CA1307 ("Specify StringComparison for clarity"). Direct calls without usingWith
have the default context-dependent behaviour which may not be the developer's intent. UsingWith
makes the developer's intent clear. The warning could be suppressed if desired, or indeed it could be severityNone
by default, increased toWarning
according to user preference.Differing opinions welcome.