castle-windsor

Castle Windsor Cannot find my Service Type

◇◆丶佛笑我妖孽 提交于 2019-12-11 11:29:42
问题 Trying to make use of the Castle Windsor IoC. I have a very simple application. My interfaces exist in Test.Services namespace. I get the following exception when compiling: "The type name Test.Services.IParse, Test.Services could not be located" This is my app.config: <configuration> <configSections> <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" /> </configSections> <castle> <components> <component id="HtmlTitleRetriever" type="Test

Castle Windsor Xamarin PCL

最后都变了- 提交于 2019-12-11 11:07:39
问题 I'm attempting to include Castle.Windsor in a Xamarin 3.0 project and a Portable class library that will be used in the project. When I attempt to include this via nuget, I get the following error PM> install-package castle.Windsor Attempting to resolve dependency 'Castle.Core (≥ 3.3.0)'. Installing 'Castle.Core 3.3.0'. Successfully installed 'Castle.Core 3.3.0'. Installing 'Castle.Windsor 3.3.0'. Successfully installed 'Castle.Windsor 3.3.0'. Adding 'Castle.Core 3.3.0' to FuelCog.Core

MVVM - Using entities in ViewModels

给你一囗甜甜゛ 提交于 2019-12-11 10:56:10
问题 I am really just starting out with MVVM, IoC and Dependency Injection and I've hit a stumbling block that I don't know how to solve but I do understand why it's happening. I am using Castle Windsor for DI and IoC functionality and MVVM Light as my MVVM framework in a WPF application. Using this tutorial I have managed to get Castle Windsor to create a MainPageViewModel that has a IGroupRepository injected into the constructor. I have registered a mock implementation of this in Castle Windsor.

List all IRegistrations in WindsorContainer/Kernel

别来无恙 提交于 2019-12-11 10:36:47
问题 How do I get a list of all IRegistrations/ComponentRegistrations in my WindsorContainer or its kernel? I can see a way of doing this by wiring to the ComponentRegistered event and tracking there, but is there an eaiser way? Thanks. 回答1: You can get the handlers from the container, but not the IRegistrations: IHandler[] handlers = container.Kernel.GetAssignableHandlers(typeof(object)); Handlers are basically the registered components. IHandler.ComponentModel contains most of the information of

Share castle windsor container between projects asp.net mvc

拥有回忆 提交于 2019-12-11 09:56:12
问题 I have a asp.net mvc web project and I have initialised my windsor container in my global.asax application start. I need this container for my solrnet facility. private static IWindsorContainer _container; private static IWindsorContainer Container { get{ if (_container == null) { throw new Exception("The container in global application object is null"); } return _container; } } IWindsorContainer IContainerAccessor.Container { get { return Container; } } protected void Application_Start() {

How to resolve an user repository using Windsor IoC at the start of the application?

无人久伴 提交于 2019-12-11 08:49:30
问题 I get an error message "Object reference not set to an instance of an object." when I try to use an UserRepos repository. Question is how can I resolve user repository at the start of the application (ASP.NET MVC) What is wrong here? public class MyApplication : HttpApplication { public IUserRepository UserRepos; public IWindsorContainer Container; protected void Application_Start() { Container = new WindsorContainer(); // Application services Container.Register( Component.For<IUserRepository

Castle Windsor equivalent of StructureMap ObjectFactory.With<>().GetInstance<>()

纵然是瞬间 提交于 2019-12-11 08:41:00
问题 With StructureMap one can do a resolution and force the container to use specific dependency instance provided at the time of resolution like so: ObjectFactory.With<ISomeDependency>(someDepedencyInstance).GetInstance<IServiceType>() Provided instance will be used in whole resolution chain, that is not only as a direct dependency of IServiceType implementation but also as a dependency of any direct and indirect dependencies of IServiceType implementation. How do I do something like that in

How to setup Windsor component that needs to depend on a dynamic string?

无人久伴 提交于 2019-12-11 08:37:47
问题 I have a Castle Windsor component, that depends on a string. The string needs to be determined at runtime, based on another string, which is constant and can be set in the component configuration. How do I wire this up using Castle Windsor ? The problem is general, but the specific scenario I need it for is a class that takes the full path to file in a constructor, but since I am running a ASP .NET app, I only know the virtual (relative) path of the file when writing the configuration file.

Windsor IHandlerSelector in RIA Services Visual Studio 2010 Beta2

余生长醉 提交于 2019-12-11 08:34:24
问题 I want to implement multi tenancy using Windsor and i don't know how to handle this situation: i succesfully used this technique in plain ASP.NET MVC projects and thought incorporating in a RIA Services project would be similar. So i used IHandlerSelector, registered some components and wrote an ASP.NET MVC view to verify it works in a plain ASP.NET MVC environment. And it did! Next step was to create a DomainService which got an IRepository injected in the constructor. This service is hosted

How do I use Castle Windsor to create a RavenDB session with client version > 3.0.3660?

﹥>﹥吖頭↗ 提交于 2019-12-11 07:58:27
问题 I am using Castle Windsor v3.4.0 to create a RavenDB document session instance but when I use a RavenDB client version later than 3.0.3660 I get this error when calling the Store method: Castle.MicroKernel.ComponentNotFoundException: 'No component for supporting the service System.Net.Http.HttpMessageHandler was found' Here is the smallest piece code I can come up with that reproduces the error: using Castle.Facilities.TypedFactory; using Castle.MicroKernel.Registration; using Castle.Windsor;