Rhino.Mocks. I would revert it due to the fact that it breaks
> Hi,
>
> This breaks the Wcf facility (and probably more stuff, but I'm not sure).
> For instance, in Wcf facility there's no service metadata available because
> ComponentModel.Configuration is never set, causing WcfUtils.FindBehaviors<>
> to never find any IServiceBehavior handlers.
>
> I think that the problem is that ComponentRegistration is not using
> ComponentModelBuilder for construction, but new'ing ComponentModel instead.
>
> Any objections to reverting this patch?
>
> -- Roelof.
>
> On Wed, Jul 9, 2008 at 3:12 PM, <
notification@...> wrote:
>>
>> User: enix
>> Date: 2008/07/09 06:12 AM
>>
>> Modified:
>> /trunk/InversionOfControl/Castle.MicroKernel/Registration/
>> ComponentInstanceDescriptor.cs, ComponentRegistration.cs
>>
>> Log:
>> Better fix for the dependency exception that occurred when resolving a
>> component instance that has c'tor arguments. This patch excluded the
>> component from being inspected for registration. This allows the
>> registration of Stub instanced generated by Rhino.Mocks.
>>
>> File Changes:
>>
>> Directory: /trunk/InversionOfControl/Castle.MicroKernel/Registration/
>> =====================================================================
>>
>> File [modified]: ComponentInstanceDescriptor.cs
>> Delta lines: +0 -5
>> ===================================================================
>> ---
>> trunk/InversionOfControl/Castle.MicroKernel/Registration/ComponentInstanceDescriptor.cs
>> 2008-07-08 20:49:29 UTC (rev 5221)
>> +++
>> trunk/InversionOfControl/Castle.MicroKernel/Registration/ComponentInstanceDescriptor.cs
>> 2008-07-09 13:12:54 UTC (rev 5222)
>> @@ -30,11 +30,6 @@
>> {
>> model.CustomComponentActivator =
>> typeof(ExternalInstanceActivator);
>> model.ExtendedProperties["instance"] = instance;
>> -
>> - // The constructor collection is filled because
>> the instance gets inspected
>> - // by the kernel when added. The kernel doesn't
>> need to resolve any
>> - // dependencies since we pass an instance.
>> - model.Constructors.Clear();
>> }
>> }
>> }
>> \ No newline at end of file
>>
>> File [modified]: ComponentRegistration.cs
>> Delta lines: +9 -4
>> ===================================================================
>> ---
>> trunk/InversionOfControl/Castle.MicroKernel/Registration/ComponentRegistration.cs
>> 2008-07-08 20:49:29 UTC (rev 5221)
>> +++
>> trunk/InversionOfControl/Castle.MicroKernel/Registration/ComponentRegistration.cs
>> 2008-07-09 13:12:54 UTC (rev 5222)
>> @@ -37,6 +37,7 @@
>> {
>> private String name;
>> private bool overwrite;
>> + private bool isInstanceRegistration;
>> private Type serviceType;
>> private Type implementation;
>> private List<Type> forwardedTypes = new List<Type>();
>> @@ -159,6 +160,7 @@
>> throw new
>> ArgumentNullException("instance");
>> }
>>
>> + isInstanceRegistration = true;
>> ImplementedBy(instance.GetType());
>> return AddDescriptor(new
>> ComponentInstanceDescriptior<S>(instance));
>> }
>> @@ -504,12 +506,15 @@
>>
>> descriptor.ApplyToConfiguration(kernel, configuration);
>> }
>>
>> - if (componentModel == null)
>> + if (componentModel == null &&
>> isInstanceRegistration == false)
>> {
>> - componentModel =
>> kernel.ComponentModelBuilder.BuildModel(
>> - name, serviceType,
>> implementation, null);
>> + componentModel =
>> kernel.ComponentModelBuilder.BuildModel(name, serviceType, implementation,
>> null);
>> + }
>> + else if (componentModel == null &&
>> isInstanceRegistration)
>> + {
>> + componentModel = new
>> ComponentModel(name, serviceType, implementation);
>> }
>> -
>> +
>> foreach (ComponentDescriptor<S> descriptor
>> in descriptors)
>> {
>> descriptor.ApplyToModel(kernel,
>> componentModel);
>>
>>
>>
>
>
> >
>
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.