castle

asp.net mvc test project cannot find windsor file

五迷三道 提交于 2020-01-17 02:20:54
问题 Hi there Im using windsor as a DI container, my code is below public static class ContainerBuilder { public static IWindsorContainer Build() { var container = new WindsorContainer("Configuration\\Windsor.config"); // automatically register controllers container.Register(AllTypes .Of<Controller>() .FromAssembly(Assembly.GetExecutingAssembly()) .Configure(c => c.LifeStyle.Transient.Named(c.Implementation.Name.ToLower()))); container.Register( Component.For<IServiceLocator>().Instance(new

Castle Facilities NHibernateIntegration for NHibernate 4.0

痞子三分冷 提交于 2020-01-16 00:50:26
问题 I downloaded the source for NHibernateIntegration from (https://github.com/mahara/Castle.Facilities.NHibernateIntegration) I added reference for Castle.Core (3.3.0.0), Castle.Services.Transaction (3.3.0.0), Castle.Windsor (3.3.0.0), NHibernate (4.0.0.4000) and I built the application to generate the Castle.Facilities.NHibernateIntegration.dll But after the upgrading NHibernateIntegration.dll in my application I am getting the following error, An ISessionFactory component was not mapped for

Castle 3.0 WCF Facility - Not resolving paramters in service constructor

末鹿安然 提交于 2020-01-14 16:33:49
问题 I'm trying to have Castle (3.0) inject constructor params into a WCF service, like this ServiceHostBase clientServiceHost = new Castle.Facilities.WcfIntegration.DefaultServiceHostFactory() .CreateServiceHost(typeof(IClientExchange).AssemblyQualifiedName, new Uri[0]); However I get the following exception 'The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor.' The service impl of type ClientExchange takes a constructor param

Castle 3.0 WCF Facility - Not resolving paramters in service constructor

会有一股神秘感。 提交于 2020-01-14 16:31:23
问题 I'm trying to have Castle (3.0) inject constructor params into a WCF service, like this ServiceHostBase clientServiceHost = new Castle.Facilities.WcfIntegration.DefaultServiceHostFactory() .CreateServiceHost(typeof(IClientExchange).AssemblyQualifiedName, new Uri[0]); However I get the following exception 'The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor.' The service impl of type ClientExchange takes a constructor param

Unity Factory Injection

爱⌒轻易说出口 提交于 2020-01-14 13:08:32
问题 I have an interface like the below one which I inject into unity container. public interface IMyInstanceFactory { IEnumerable<IMyInstance> GetAll(); } All IMyInstance are known before runtime i.e they can be setup within the bootstrapper and can be retrieved from unity. My concrete implementation for IMyInstanceFactory is as below: public class MyInstanceFactory:IMyInstanceFactory { IUnityContainer _container; public MyInstanceFactory(IUnityContainer container) { _container = container; }

Unity Factory Injection

倾然丶 夕夏残阳落幕 提交于 2020-01-14 13:07:13
问题 I have an interface like the below one which I inject into unity container. public interface IMyInstanceFactory { IEnumerable<IMyInstance> GetAll(); } All IMyInstance are known before runtime i.e they can be setup within the bootstrapper and can be retrieved from unity. My concrete implementation for IMyInstanceFactory is as below: public class MyInstanceFactory:IMyInstanceFactory { IUnityContainer _container; public MyInstanceFactory(IUnityContainer container) { _container = container; }

How can I check for an InternalsVisibleTo attribute on an assembly?

坚强是说给别人听的谎言 提交于 2020-01-05 08:07:10
问题 I've used ILMerge to merge a secondary assembly that is itself merged with Castle.DynamicProxy, having set most if not all of the normally-public Castle types to internal. When I use the code from the secondary assembly that is dependent on the Castle types, I get a TypeLoadException saying that access is denied. The first step to check is that my merged assembly has the InternalsVisibleTo attribute still set for the DynamicProxy2 assembly. Any way to check this? 回答1: DotPeek shows this by

Cannot retrieve CustomAttributes in Interceptor using DynamicProxy

旧巷老猫 提交于 2020-01-03 02:52:16
问题 I'm currently implementing Interceptors using Castle DynamicProxy. I require the interceptor to pick up some custom attributes on my service layer method, but invocation.Method.GetCustomAttributes returns nothing. Anything I could be doing wrong? Intercepted Method: [Transaction()] [SecurityRole(AuthenticationRequired = false, Role = SystemRole.Unauthorised)] public virtual void LoginUser(out SystemUser userToLogin, string username) { ... } Interceptor: // Checks that a security attribute has

NuGet: NHibernate, Castle.Core 3.0 and where is ProxyFactoryFactory?

柔情痞子 提交于 2019-12-28 13:57:20
问题 I installed with NuGet the packages NHibernate and Castle.Core 3.0 for a new project. Usually we copied around the dlls manually; it is the first time I do that with NuGet. Now I can't find out how to configure the ProxyFactoryFactory, or let's say, I can't find it. I referenced NHibernate and Castle.Core (the only dll I could find in the Castle.Core - package) within the project, and configured the following: <property name="proxyfactory.factory_class"> NHibernate.ByteCode.Castle

NuGet: NHibernate, Castle.Core 3.0 and where is ProxyFactoryFactory?

无人久伴 提交于 2019-12-28 13:56:39
问题 I installed with NuGet the packages NHibernate and Castle.Core 3.0 for a new project. Usually we copied around the dlls manually; it is the first time I do that with NuGet. Now I can't find out how to configure the ProxyFactoryFactory, or let's say, I can't find it. I referenced NHibernate and Castle.Core (the only dll I could find in the Castle.Core - package) within the project, and configured the following: <property name="proxyfactory.factory_class"> NHibernate.ByteCode.Castle