User: xtoff
Date: 2009/12/18 08:42 AM

Modified:
 /InversionOfControl/trunk/src/Castle.MicroKernel/Facilities/Remoting/
  RemotingFacility.cs
 /InversionOfControl/trunk/src/Castle.MicroKernel/Facilities/TypedFactory/
  TypedFactoryFacility.cs
 /InversionOfControl/trunk/src/Castle.MicroKernel/Lifestyle/
  PerWebRequestLifestyleManager.cs
 /InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/
  ComponentActivatorInspector.cs, ComponentProxyInspector.cs, 
InterceptorInspector.cs, LifestyleModelInspector.cs, MethodMetaInspector.cs
 /InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/
  IoC_155.cs
 /InversionOfControl/trunk/src/Castle.Windsor.Tests/Proxy/
  ProxyBehaviorInvalidTestCase.cs
 /InversionOfControl/trunk/src/Castle.Windsor/Configuration/AppDomain/
  CastleSectionHandler.cs
 /InversionOfControl/trunk/src/Castle.Windsor/Configuration/Interpreters/
  AbstractInterpreter.cs, XmlInterpreter.cs
 /InversionOfControl/trunk/src/Castle.Windsor/Installer/
  DefaultComponentInstaller.cs

Log:
 Applied patch from Simon Cropp for IOC-ISSUE-177 - 
ConfigurationErrorsException for silverlight

File Changes:

Directory: /InversionOfControl/trunk/src/Castle.Windsor/Configuration/AppDomain/
================================================================================

File [modified]: CastleSectionHandler.cs
Delta lines: +1 -3
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Configuration/Interpreters/AbstractInterpreter.cs
       2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Configuration/Interpreters/AbstractInterpreter.cs
       2009-12-18 15:42:28 UTC (rev 6453)
@@ -16,8 +16,6 @@
 {
        using System;
        using System.Collections;
-       using System.Configuration;
-
        using Castle.Core.Resource;
        using Castle.Core.Configuration;
        using Castle.MicroKernel;
@@ -181,7 +179,7 @@
                        {
                                const string message = "Component or Facility 
was declared without a proper 'id' attribute";
 
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
                }

Directory: /InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/
===================================================================

File [modified]: IoC_155.cs
Delta lines: +2 -2
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor.Tests/Proxy/ProxyBehaviorInvalidTestCase.cs
     2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.Windsor.Tests/Proxy/ProxyBehaviorInvalidTestCase.cs
     2009-12-18 15:42:28 UTC (rev 6453)
@@ -16,7 +16,7 @@
 
 namespace Castle.Windsor.Tests.Proxy
 {
-       using System.Configuration;
+       using System;
        using Castle.Core.Interceptor;
        using Castle.MicroKernel;
        using Castle.Windsor.Tests.Components;
@@ -25,7 +25,7 @@
        [TestFixture]
        public class ProxyBehaviorInvalidTestCase
        {
-               [Test, ExpectedException(typeof(ConfigurationErrorsException))]
+               [Test, ExpectedException(typeof(Exception))]
                public void InvalidProxyBehaviorFromConfiguration()
                {

Directory: 
/InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/
====================================================================================

File [modified]: ComponentActivatorInspector.cs
Delta lines: +2 -4
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/ComponentProxyInspector.cs
  2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/ComponentProxyInspector.cs
  2009-12-18 15:42:28 UTC (rev 6453)
@@ -76,8 +76,7 @@
                                }
                                catch(ConverterException ex)
                                {
-                                       throw new 
ConfigurationErrorsException("Could not convert attribute " + 
-                                               "'useSingleInterfaceProxy' to 
bool. Value is " + useSingleInterfaceProxyAttrib, ex);
+                                       throw new 
Exception(string.Format("Could not convert attribute 'useSingleInterfaceProxy' 
to bool. Value is '{0}'.", useSingleInterfaceProxyAttrib), ex);
                                }
                        }
 
@@ -90,8 +89,7 @@
                                }
                                catch(ConverterException ex)
                                {
-                                       throw new 
ConfigurationErrorsException("Could not convert attribute " + 
-                                               "'marshalByRefProxy' to bool. 
Value is " + marshalByRefProxyAttrib, ex);
+                                       throw new 
Exception(string.Format("Could not convert attribute 'marshalByRefProxy' to 
bool. Value is '{0}'.", marshalByRefProxyAttrib), ex);
                                }
                        }

File [modified]: ComponentProxyInspector.cs
Delta lines: +1 -3
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/InterceptorInspector.cs
     2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/InterceptorInspector.cs
     2009-12-18 15:42:28 UTC (rev 6453)
@@ -15,8 +15,6 @@
 namespace Castle.MicroKernel.ModelBuilder.Inspectors
 {
        using System;
-       using System.Configuration;
-
        using Castle.MicroKernel.Util;
        using Castle.Core;
        using Castle.Core.Configuration;
@@ -53,7 +51,7 @@
                                                "to a component (Currently 
{0})", 
                                                value);
 
-                                       throw new 
ConfigurationErrorsException(message);
+                                       throw new Exception(message);
                                }
 

File [modified]: InterceptorInspector.cs
Delta lines: +3 -5
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/LifestyleModelInspector.cs
  2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/LifestyleModelInspector.cs
  2009-12-18 15:42:28 UTC (rev 6453)
@@ -15,8 +15,6 @@
 namespace Castle.MicroKernel.ModelBuilder.Inspectors
 {
        using System;
-       using System.Configuration;
-
        using Castle.Core;
        
        /// <summary>
@@ -73,7 +71,7 @@
                                                        "Could not convert the 
specified attribute value " + 
                                                        "{0} to a valid 
LifestyleType enum type", lifestyle);
 
-                                               throw new 
ConfigurationErrorsException(message);
+                                               throw new Exception(message);
                                        }
 
                                        if (model.LifestyleType == 
LifestyleType.Pooled)
@@ -123,14 +121,14 @@
                                        String message = String.Format(
                                                "The Type {0} specified  in the 
customLifestyleType attribute could not be loaded.", customLifestyleType);
 
-                                       throw new 
ConfigurationErrorsException(message);
+                                       throw new Exception(message);
                                }
                        }
                        else
                        {
                                const string message = @"The attribute 
'customLifestyleType' must be specified in conjunction with the 'lifestyle' 
attribute set to ""custom"".";
 
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
                }

File [modified]: LifestyleModelInspector.cs
Delta lines: +3 -6
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/MethodMetaInspector.cs
      2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/MethodMetaInspector.cs
      2009-12-18 15:42:28 UTC (rev 6453)
@@ -17,12 +17,9 @@
 {
        using System;
        using System.Collections.Generic;
-       using System.Configuration;
        using System.Reflection;
-
        using Castle.Core;
        using Castle.Core.Configuration;
-
        using Castle.MicroKernel.SubSystems.Conversion;
 
        /// <summary>
@@ -91,7 +88,7 @@
                                                String message = String.Format( 
"The class {0} has tried to expose configuration for " + 
                                                        "a method named {1} 
which could not be found.", model.Implementation.FullName, name );
 
-                                               throw new 
ConfigurationErrorsException(message);
+                                               throw new Exception(message);
                                        }
 
                                        ProcessMeta(model, methods, metaModel);
@@ -128,7 +125,7 @@
                                        "for the component '{0}' does not have 
a name. You can either name " + 
                                        "the node as the method name or provide 
an attribute 'name'", model.Name);
 
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
                }
 
@@ -186,7 +183,7 @@
                                                "that could not be converted to 
System.Type. Check the inner exception for " + 
                                                "details", signature, param);
 
-                                       throw new 
ConfigurationErrorsException(message);
+                                       throw new Exception(message);
                                }
                        }

File [modified]: MethodMetaInspector.cs
Delta lines: +3 -1
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Configuration/AppDomain/CastleSectionHandler.cs
 2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Configuration/AppDomain/CastleSectionHandler.cs
 2009-12-18 15:42:28 UTC (rev 6453)
@@ -12,9 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+
 namespace Castle.Windsor.Configuration.AppDomain
 {
        using System.Configuration;
+       using System.Xml;
 
        /// <summary>
        /// Implementation of <see cref="IConfigurationSectionHandler"/>.
@@ -26,7 +28,7 @@
                {
                }
 
-               public object Create(object parent, object configContext, 
System.Xml.XmlNode section)
+               public object Create(object parent, object configContext, 
XmlNode section)
                {
                        return section;

Directory: /InversionOfControl/trunk/src/Castle.Windsor/Installer/
==================================================================

File [modified]: DefaultComponentInstaller.cs
Delta lines: +19 -19
===================================================================

--- InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_155.cs   
2009-12-18 08:42:36 UTC (rev 6452)
+++ InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_155.cs   
2009-12-18 15:42:28 UTC (rev 6453)
@@ -16,34 +16,34 @@
 
 namespace Castle.Windsor.Tests.Bugs
 {
-       using System.Configuration;
-    using Core.Resource;
-    using NUnit.Framework;
-    using Windsor.Configuration.Interpreters;
+       using System;
+       using Core.Resource;
+       using NUnit.Framework;
+       using Windsor.Configuration.Interpreters;
 
-    [TestFixture]
-    public class IoC_155
-    {
-        public interface IService { }
+       [TestFixture]
+       public class IoC_155
+       {
+               public interface IService { }
 
-        public class Service : IService { }
+               public class Service : IService { }
 
-        [Test]
-        public void Type_not_implementing_service_should_throw()
-        {
-            Assert.Throws<ConfigurationErrorsException>(() =>
-                new WindsorContainer(
-                    new XmlInterpreter(
-                        new StaticContentResource(
-                            @"<castle>
+               [Test]
+               public void Type_not_implementing_service_should_throw()
+               {
+                       Assert.Throws<Exception>(() =>
+                               new WindsorContainer(
+                                       new XmlInterpreter(
+                                               new StaticContentResource(
+                                                       @"<castle>
 <components>
     <component id=""svc""
         service=""Castle.Windsor.Tests.Bugs.IoC_155+Service, 
Castle.Windsor.Tests""
         type=""Castle.Windsor.Tests.Bugs.IoC_155+IService, 
Castle.Windsor.Tests""/>
 </components>
 </castle>"))));
-        }
-    }
+               }
+       }
 }
 

Directory: 
/InversionOfControl/trunk/src/Castle.Windsor/Configuration/Interpreters/
===================================================================================

File [modified]: AbstractInterpreter.cs
Delta lines: +5 -8
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Configuration/Interpreters/XmlInterpreter.cs
    2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Configuration/Interpreters/XmlInterpreter.cs
    2009-12-18 15:42:28 UTC (rev 6453)
@@ -18,14 +18,11 @@
 {
        using System;
        using System.Xml;
-       using System.Configuration;
        using Castle.Core.Configuration.Xml;
        using Castle.Core.Resource;
        using Castle.Core.Configuration;
-       
        using Castle.MicroKernel;
        using Castle.MicroKernel.SubSystems.Resource;
-
        using Castle.Windsor.Configuration.Interpreters.XmlProcessor;
 
        /// <summary>
@@ -104,7 +101,7 @@
                        {
                                const string message = "Unable to process xml 
resource ";
 
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
                }
 
@@ -116,7 +113,7 @@
                                {
                                        string message = String.Format("{0} 
cannot contain text nodes", node.Name);
 
-                                       throw new 
ConfigurationErrorsException(message);
+                                       throw new Exception(message);
                                }
                                if (node.NodeType == XmlNodeType.Element)
                                {
@@ -150,7 +147,7 @@
                                        "<{1}>, <{2}>, <{3}> or <{4}>. There 
might be either a typo on <{0}> or " +
                                        "you might have forgotten to nest it 
properly.",
                                        node.Name, ContainersNodeName, 
FacilitiesNodeName, ComponentsNodeName, BootstrapNodeName);
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
                }
 
@@ -250,7 +247,7 @@
                                String message = String.Format("{0} elements 
expects required non blank attribute {1}",
                                                                                
           configuration.Name, attributeName);
 
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
 
                        return value;                   
@@ -264,7 +261,7 @@
                        String message = String.Format("Unexpected node under 
'{0}': Expected '{1}' but found '{2}'",
                                                                                
   expectedName, expectedName, node.Name);
 
-                       throw new ConfigurationErrorsException(message);
+                       throw new Exception(message);
                }
        }

File [modified]: XmlInterpreter.cs
Delta lines: +8 -10
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Installer/DefaultComponentInstaller.cs
  2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Installer/DefaultComponentInstaller.cs
  2009-12-18 15:42:28 UTC (rev 6453)
@@ -16,8 +16,6 @@
 {
        using System;
        using System.Collections.Generic;
-       using System.Configuration;
-
        using Castle.Core.Configuration;
        using Castle.Core.Resource;
        using Castle.MicroKernel;
@@ -107,7 +105,7 @@
                        {
                                var message = string.Format("Could not set up 
component '{0}'. Type '{1}' does not implement service '{2}'", id,
                                                            
type.AssemblyQualifiedName, service.AssemblyQualifiedName);
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
                }
 
@@ -125,9 +123,9 @@
                                {
                                        
forwarded.Add(ObtainType(forwardedServiceTypeName));
                                }
-                               catch (ConfigurationErrorsException e)
+                               catch (Exception e)
                                {
-                                       throw new ConfigurationErrorsException(
+                                       throw new Exception(
                                                string.Format("Component 
{0}-{1} defines invalid forwarded type.", id ?? string.Empty, typeName), e);
                                }
                        }
@@ -161,9 +159,9 @@
                        }
                        catch (Exception e)
                        {
-                               String message = String.Format("The type name 
{0} could not be located", typeName);
+                               String message = String.Format("The type name 
{0} could not be located.", typeName);
 
-                               throw new ConfigurationErrorsException(message, 
e);
+                               throw new Exception(message, e);
                        }
                }
 
@@ -171,9 +169,9 @@
                {
                        if (!typeof(IFacility).IsAssignableFrom( facilityType ))
                        {
-                               String message = String.Format("Type {0} does 
not implement the interface IFacility", facilityType.FullName);
+                               String message = String.Format("Type {0} does 
not implement the interface IFacility.", facilityType.FullName);
 
-                               throw new ConfigurationErrorsException(message);
+                               throw new Exception(message);
                        }
 
                        try
@@ -184,7 +182,7 @@
                        {
                                String message = String.Format("Could not 
instantiate {0}. Does it have a public default constructor?", 
facilityType.FullName);
 
-                               throw new ConfigurationErrorsException(message, 
ex);
+                               throw new Exception(message, ex);
                        }
                }

Directory: /InversionOfControl/trunk/src/Castle.MicroKernel/Lifestyle/
======================================================================

File [modified]: PerWebRequestLifestyleManager.cs
Delta lines: +1 -2
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/ComponentActivatorInspector.cs
      2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/ModelBuilder/Inspectors/ComponentActivatorInspector.cs
      2009-12-18 15:42:28 UTC (rev 6453)
@@ -15,7 +15,6 @@
 namespace Castle.MicroKernel.ModelBuilder.Inspectors
 {
        using System;
-       using System.Configuration;
        using Castle.Core;
 
        /// <summary>
@@ -82,7 +81,7 @@
                                                String.Format("The Type '{0}' 
specified  in the componentActivatorType attribute could not be loaded.",
                                                              
componentActivatorType);
 
-                                       throw new 
ConfigurationErrorsException(message, ex);
+                                       throw new Exception(message, ex);
                                }
                        }

Directory: /InversionOfControl/trunk/src/Castle.Windsor.Tests/Proxy/
====================================================================

File [modified]: ProxyBehaviorInvalidTestCase.cs
Delta lines: +0 -0
===================================================================

Directory: /InversionOfControl/trunk/src/Castle.MicroKernel/Facilities/Remoting/
================================================================================

File [modified]: RemotingFacility.cs
Delta lines: +1 -4
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/Facilities/TypedFactory/TypedFactoryFacility.cs
     2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/Facilities/TypedFactory/TypedFactoryFacility.cs
     2009-12-18 15:42:28 UTC (rev 6453)
@@ -16,11 +16,8 @@
 namespace Castle.Facilities.TypedFactory
 {
        using System;
-       using System.Configuration;
-       
        using Castle.Core;
        using Castle.Core.Configuration;
-
        using Castle.MicroKernel;
        using Castle.MicroKernel.Facilities;
        using Castle.MicroKernel.Proxy;
@@ -78,7 +75,7 @@
                                        {
                                                string message = "Invalid 
factory entry in configuration";
 
-                                               throw new 
ConfigurationErrorsException(message);
+                                               throw new Exception(message);
                                        }
                                }

Directory: 
/InversionOfControl/trunk/src/Castle.MicroKernel/Facilities/TypedFactory/
====================================================================================

File [modified]: TypedFactoryFacility.cs
Delta lines: +4 -8
===================================================================

--- 
InversionOfControl/trunk/src/Castle.MicroKernel/Lifestyle/PerWebRequestLifestyleManager.cs
  2009-12-18 08:42:36 UTC (rev 6452)
+++ 
InversionOfControl/trunk/src/Castle.MicroKernel/Lifestyle/PerWebRequestLifestyleManager.cs
  2009-12-18 15:42:28 UTC (rev 6453)
@@ -16,7 +16,6 @@
 {
        using System;
        using System.Collections.Generic;
-       using System.Configuration;
        using System.Web;
 
        /// <summary>
@@ -28,7 +27,7 @@
 #endif
        public class PerWebRequestLifestyleManager : AbstractLifestyleManager
        {
-               private string PerRequestObjectID = 
"PerRequestLifestyleManager_" + Guid.NewGuid().ToString();
+               private string PerRequestObjectID = 
"PerRequestLifestyleManager_" + Guid.NewGuid();
 
                #region ILifestyleManager Members
 
@@ -38,18 +37,15 @@
 
                        if (current == null)
                                throw new InvalidOperationException(
-                                       "HttpContext.Current is null.  
PerWebRequestLifestyle can only be used in ASP.Net");
+                                       "HttpContext.Current is null. 
PerWebRequestLifestyle can only be used in ASP.Net");
 
                        if (current.Items[PerRequestObjectID] == null)
                        {
                                if (!PerWebRequestLifestyleModule.Initialized)
                                {
-                                       string message = "Looks like you forgot 
to register the http module " +
-                                                        
typeof(PerWebRequestLifestyleModule).FullName + Environment.NewLine +
-                                                        "Add '<add 
name=\"PerRequestLifestyle\" 
type=\"Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, 
Castle.MicroKernel\" />' " +
-                                                        "to the <httpModules> 
section on your web.config";
+                                       string message = string.Format("Looks 
like you forgot to register the http module {0}{1}Add '<add 
name=\"PerRequestLifestyle\" 
type=\"Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, 
Castle.MicroKernel\" />' to the <httpModules> section on your web.config", 
typeof(PerWebRequestLifestyleModule).FullName, Environment.NewLine);
 
-                                       throw new 
ConfigurationErrorsException(message);
+                                       throw new Exception(message);
                                }
 

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" 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-commits?hl=en.


Reply via email to