Reputation: 18895
Our company is making the switch from Microsoft.Practices.Enterprise.Library
logging and exception handling to using Log4Net
. I removed all of the standard logging and exception handling calls, replacing them with the Log4Net
equivalents, but when I removed the Practices Dlls, I noticed that we were using them for ExceptionShielding:
using System;
using System.ServiceModel;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF;
namespace CRM.WCFServices.LeadIntegration.ServiceContracts
{
/// <summary>
/// Interface for systems external to CRM to interact with outbound calls.
/// </summary>
[ExceptionShielding("WCF Exception Shielding")]
[ServiceContract]
public interface IOutboundIntegrationService
{
#region Contracts
[OperationContract]
[FaultContract(typeof (Common.Services.WCF.FaultContracts.ServiceFault))]
void SendOutboundData(string entityName, Guid entityId, DateTime modifiedOn, Guid modifiedBy,
string crmOrganization);
#endregion
}
}
The basic question is "How can I safely remove it?" which involves answering most of these questions:
Upvotes: 2
Views: 387
Reputation: 161773
If I remember correctly, the purpose of the Exception Shielding feature was to
Make your choice.
If my memory is correct, then all you need to do is either turn includeExceptionDetailInFaults
to false in the web.config, or to put try/catch blocks around your service methods:
try
{
// service code
}
catch (Exception ex)
{
// Log the exception
throw new FaultException("Unknown service failure");
}
Upvotes: 1