Esempio n. 1
0
 internal static void TryLogConfigurationFailure(ActivationException configurationException)
 {
     try
     {
         var logger = EnterpriseLibraryContainer.Current.GetInstance <DefaultLoggingEventLogger>();
         logger.LogConfigurationError(configurationException);
     }
     catch
     { }
 }
Esempio n. 2
0
 private static void TryLogConfigurationError(ActivationException configurationException, string instanceName)
 {
     try
     {
         DefaultSecurityEventLogger eventLogger = EnterpriseLibraryContainer.Current.GetInstance <DefaultSecurityEventLogger>();
         if (eventLogger != null)
         {
             eventLogger.LogConfigurationError(instanceName, Resources.ErrorAuthorizationConfigurationFailedMessage, configurationException);
         }
     }
     catch { }
 }
Esempio n. 3
0
 private static void TryLogConfigurationError(ActivationException configurationException, string instanceName)
 {
     try
     {
         DefaultCachingEventLogger eventLogger = EnterpriseLibraryContainer.Current.GetInstance <DefaultCachingEventLogger>();
         if (eventLogger != null)
         {
             eventLogger.LogConfigurationError(instanceName, configurationException);
         }
     }
     catch { }
 }
Esempio n. 4
0
        private object TryGetObjectFromKernel(Type typeToBeCreated, IKernel kernel)
        {
            Object result = null;

            try
            {
                result = kernel.Get(typeToBeCreated);
            }
            catch (ActivationException ex)
            {
                activationException = ex;
            }

            return(result);
        }
Esempio n. 5
0
 public IoCDependencyInjectionNotFoundException(ActivationException innerException)
     : base("Dependency injection for " + typeof(T) + " not found", innerException)
 {
 }
            Assert_ExceptionContainsInfoAboutManualCollectionRegistrationMixedDecoratorsThatTakeAFunc(
            ActivationException ex)
        {
            AssertThat.StringContains(string.Format(
                "impossible for the container to generate a {0} for injection into the {1} decorator",
                    typeof(Func<ICommandHandler<RealCommand>>).ToFriendlyName(),
                    typeof(AsyncCommandHandlerProxy<>).ToFriendlyName()),
                ex.Message);

            AssertThat.StringContains(
                "the registration hasn't been made using one of the RegisterCollection overloads that take " +
                "a list of System.Type",
                ex.Message);

            AssertThat.StringContains(
                "switch to one of the other RegisterCollection overloads, or don't use a decorator that " +
                "depends on a Func<T>",
                ex.Message);
        }
 internal static void ThrowExn(ActivationException err)
 {
     throw WrapExn(err);
 }
 internal static DependencyException WrapExn(ActivationException err)
 {
     return(new DependencyException(err.Message, err));
 }