I'm not an expert on this, I think Hammett will have best idea, but does
that fail at runtime?
On 08/03/2011 10:13 PM, Rammesses wrote:
This might be a false positive from Code Analysis, but it's a right
pain.
I want to use the Castle LoggingFacility within Silverlight (so that I
have the same logging API on both client and server code.
Locally, everything builds and runs fine, but on our build server, we
get a load of CA2140 errors. Has anyone else hit this issue?
The code in question comes from my PRISM bootstrapper.
///<summary>
/// Registers the logging facility.
///</summary>
protected void RegisterLoggingFacility()
{
this.Container.AddFacility<LoggingFacility>(f =>
ConfigureLoggingFacility(f));
}
///<summary>
/// Called when creating a logging facility to configure it..
///</summary>
///<param name="facility">The facility.</param>
private static void ConfigureLoggingFacility(LoggingFacility facility)
{
facility.LogUsing<CastleSilverlightLoggerFactory>();
}
And the errors I get are as follows:
Prism\WindsorBootstrapper.cs (184): CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)'
references security critical method 'LoggingFacility.LogUsing()'. In
order for this reference to be allowed under the security transparency
rules, either
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)' must
become security critical or safe-critical, or
'LoggingFacility.LogUsing()' become security safe-critical or
transparent.
Prism\WindsorBootstrapper.cs (184):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)' has
parameter 'facility' of security critical type 'LoggingFacility'. In
order for this parameter to be
allowed under the security
transparency rules, either
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)' must
become security critical or
safe-critical, or 'LoggingFacility'
must become security safe-critical or transparent.
Prism\WindsorBootstrapper.cs (175):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.RegisterLoggingFacility()' references security
critical method
'Action.Action(object, IntPtr)'. In order for this
reference to be allowed under the
security transparency rules, either
'WindsorBootstrapper.RegisterLoggingFacility()' must become security
critical or
safe-critical, or
'Action.Action(object, IntPtr)' become security
safe-critical or transparent.
Prism\WindsorBootstrapper.cs (176):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.RegisterLoggingFacility()' has parameter 'f' of
security
critical type 'LoggingFacility'. In order for this parameter to be
allowed under the security
transparency rules, either
'WindsorBootstrapper.RegisterLoggingFacility()' must become security
critical or
safe-critical, or 'LoggingFacility'
must become security safe-critical or transparent.
Prism\WindsorBootstrapper.cs (184):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)'
references security critical method
'LoggingFacility.LogUsing()'. In order for this reference to be
allowed under the security
transparency rules, either
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)' must
become security critical or
safe-critical, or
'LoggingFacility.LogUsing()' become security safe-critical or
transparent.
Prism\WindsorBootstrapper.cs (184):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)' has
parameter 'facility' of security critical type 'LoggingFacility'. In
order for this parameter to be
allowed under the security
transparency rules, either
'WindsorBootstrapper.ConfigureLoggingFacility(LoggingFacility)' must
become security critical or
safe-critical, or 'LoggingFacility'
must become security safe-critical or transparent.
Prism\WindsorBootstrapper.cs (175):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.RegisterLoggingFacility()' references security
critical method
'Action.Action(object, IntPtr)'. In order for this
reference to be allowed under the
security transparency rules, either
'WindsorBootstrapper.RegisterLoggingFacility()' must become security
critical or
safe-critical, or
'Action.Action(object, IntPtr)' become security
safe-critical or transparent.
Prism\WindsorBootstrapper.cs (176):
CA2140 : Microsoft.Security :
Transparent method
'WindsorBootstrapper.RegisterLoggingFacility()' has parameter 'f' of
security
critical type 'LoggingFacility'. In order for this parameter to be
allowed under the security
transparency rules, either
'WindsorBootstrapper.RegisterLoggingFacility()' must become security
critical or
safe-critical, or 'LoggingFacility'
must become security safe-critical or transparent.
Anyone got any ideas?
--
You received this message because you are subscribed to the Google Groups "Castle
Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.