Prodinner with Castle 3

Sep 23, 2011 at 12:31 AM

Hi,

 

I updated the Castle Windsor IoC to version 3, but prodinner can't compile anymore.

The following Code doesn't work anymore:

 IoC.Container.Register(AllTypes.FromAssemblyNamed(a).Pick()
                                  .WithService.DefaultInterface()
                                  .Configure(c => c.LifeStyle.PerWebRequest));


It presents the following error: 
 'Castle.MicroKernel.Registration.ServiceDescriptor' does not contain a definition for 'DefaultInterface' and no extension method 'DefaultInterface'
 accepting a first argument of type 'Castle.MicroKernel.Registration.ServiceDescriptor' could be found (are you missing a using directive or an assembly reference?)


Has anyone solved this?
Coordinator
Sep 23, 2011 at 6:38 AM

 

 

 public class WindsorRegistrar
    {
        public static void RegisterSingleton(Type interfaceType, Type implementationType)
        {
            IoC.Container.Register(Component.For(interfaceType).ImplementedBy(implementationType).LifeStyle.Singleton);
        }

        public static void Register(Type interfaceType, Type implementationType)
        {
            IoC.Container.Register(Component.For(interfaceType).ImplementedBy(implementationType).LifeStyle.PerWebRequest);
        }

        public static void RegisterAllFromAssemblies(string a)
        {
            IoC.Container.Register(AllTypes.FromAssemblyNamed(a).Pick().WithService.FirstInterface().LifestylePerWebRequest());
        }
    }

 public class WindsorConfigurator
    {
        public static void Configure()
        {
            WindsorRegistrar.Register(typeof(IConnectionFactory), typeof(ConnectionFactory));
...

            WindsorRegistrar.RegisterAllFromAssemblies("My.Service");

        }

Dec 5, 2011 at 7:31 AM

Hi,

I have updated the Castle.Windsor to version 3 and still I'm getting Outof memory exception. Is the memory leak issue is Fixed in Castle.Windsor 3?

Regards,

Chandru. BK

 

Coordinator
Dec 5, 2011 at 2:12 PM

never seen this error in 2.5 nor in 3

Dec 5, 2011 at 2:47 PM

Hi,

My application get crashes every 2 hours based on the users connected with w3wp.exe size becomes increases and start getting Out of memory exception. I have goggled and people telling that there is a memory leak issue with Windsor older versions and it has been fixed in Windsor 3 as mentioned in the link http://stackoverflow.com/questions/7523036/memory-leak-in-asp-net-mvc-3-app

I have downloaded the Windsor 3 Beta version and still facing the same issue and not resolved. I’m using MVC3 with EF4.1 with Code First Approach with Cruder.

Any help would appreciated.

Regards,

Chandru. BK

From: o [email removed]
Sent: Monday, December 05, 2011 8:43 PM
To: Chandru B.K.
Subject: Re: Prodinner with Castle 3 [prodinner:273549]

From: o

never seen this error in 2.5 nor in 3

DISCLAIMER: This email message and all attachments are confidential and may contain information that is privileged, confidential or exempt from disclosure under applicable law.  If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or to mailadmin@spanservices.com and destroy the original message.  Opinions, conclusions and other information in this message that do not relate to the official business of SPAN, shall be understood to be neither given nor endorsed by SPAN.
Coordinator
Dec 6, 2011 at 4:50 AM

I'm using the 2.5 because 3 has a bug that makes the app wait for 6 seconds each time Windsor is initialized, with memory never had problems, probably I have very few types registered

Coordinator
Dec 6, 2011 at 8:08 PM

well, I guess you could either stop using windsor or recycle your app pool every hour

Dec 7, 2011 at 11:11 AM

Hi,

Thanks for the information. Recycling the application pool is not recommended for me. Is there any recommendation to use other containers like Unity/Autofac?

I would like to use the same IOC class which I have now with different container so that my application logic is not going to change.

Regards,

Chandru. BK

From: o [email removed]
Sent: Wednesday, December 07, 2011 2:39 AM
To: Chandru B.K.
Subject: Re: Prodinner with Castle 3 [prodinner:273549]

From: o

well, I guess you could either stop using windsor or recycle your app pool every hour

DISCLAIMER: This email message and all attachments are confidential and may contain information that is privileged, confidential or exempt from disclosure under applicable law.  If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or to mailadmin@spanservices.com and destroy the original message.  Opinions, conclusions and other information in this message that do not relate to the official business of SPAN, shall be understood to be neither given nor endorsed by SPAN.
Coordinator
Dec 7, 2011 at 2:13 PM
Edited Dec 7, 2011 at 2:14 PM

don't know, haven't used anything else but I think they should be all about the same except with different API