Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 1.43 KB  |  hits: 79  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. The type ExceptionPolicyImpl has multiple constructors of length 2. Unable to disambiguate
  2. builder.ConfigureExceptionHandling()
  3.             // -----------------------------------------------------
  4.             // Preventing Enterprise Library Validation Block exceptions from getting shielded.
  5.             // -----------------------------------------------------
  6.             .GivenPolicyWithName("WCF Exception Shielding")
  7.             .ForExceptionType<FaultException<ValidationFault>>()
  8.             .ThenDoNothing()
  9.  
  10.             // -----------------------------------------------------
  11.             // Shielding unhandled exceptions
  12.             // -----------------------------------------------------
  13.             .ForExceptionType<Exception>()
  14.             .LogToCategory("My Logging Category")
  15.             .WithSeverity(TraceEventType.Critical)
  16.             .ShieldExceptionForWcf(typeof(ServiceUnhandledFault), Resources.UnhandledException_ErrorMessage)
  17.             .ThenThrowNewException();
  18.        
  19. [ServiceContract]
  20. [ValidationBehavior]
  21. [ExceptionShielding("WCF Exception Shielding")]
  22. public interface IMyService
  23. {
  24.     [OperationContract]
  25.     [FaultContract(typeof(ValidationFault))]
  26.     [FaultContract(typeof(ServiceUnhandledFault))]
  27.     void InsertEntity(MyEntity file);
  28. }
  29.  
  30. [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)]
  31. public partial class MyService : IMyService { ...Implementation... }