Hi guys,

I have a self hosted WCF service (in Windows Forms app) and I use Castle 
Windsor as DI container. I'm getting this exception:

System.TypeLoadException occurred
  _HResult=-2146233054
  _message=GenericArguments[0], 'System.ServiceModel.ServiceHostBase', on 
           'Castle.Facilities.WcfIntegration.IChannelFactoryBuilder`1[M]' 
           violates the constraint of type parameter 'M'.
  HResult=-2146233054
  IsTransient=false
  Message=GenericArguments[0], 'System.ServiceModel.ServiceHostBase', on 
          'Castle.Facilities.WcfIntegration.IChannelFactoryBuilder`1[M]' 
          violates the constraint of type parameter 'M'.
  ResourceId=0
  TypeName=""
  InnerException: 

Configuration of Castle container looks like:

Container = new WindsorContainer()
            .AddFacility<WcfFacility>();
Container.Register(
            
Component.For<IReportsService>().ImplementedBy<ReportsService>().LifestylePerWcfOperation(),
            
Component.For<IAdminServices>().ImplementedBy<AdminServices>().LifestylePerWcfOperation(),
 etc...

I create WCF service by this code:

host = new 
DefaultServiceHostFactory().CreateServiceHost(typeof(IAdminServices).AssemblyQualifiedName,
 new Uri[0]);
host.Open();

It works fine but if I run in debug with checked "break when exception is 
thrown" option debugger always stops on line

host = new 
DefaultServiceHostFactory().CreateServiceHost(typeof(IAdminServices).AssemblyQualifiedName,
 new Uri[0]);

I shows me the exception listed above.* It happens only in Visual Studio 
2013.* In VS2012 it works fine.

I use these version of Castle:

Castle.Core - 3.3.0
Castle.WcfIntegrationFacility - 3.3.0
Castle.Windsor - 3.3.0

Do I use Castle with WCF in wrong way? Can I avoid this exception? 

I have seen this question

https://groups.google.com/forum/#!msg/castle-project-users/TewcYkiP_Uc/yLW4HrbSUJgJ

But unfortunately it didn't hepled me.

Thanks in advance for any answer.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to