question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WindsorRegistrationExtensions.AddApplicationComponentsToWindsor

See original GitHub issue

Hi Everyone

in this Method I Have Problem For Registering ControllerBase For Registering Api Controller in asp Net Core 2.1

in this Method you Use this Code

foreach (var controllerRegistration in options.ControllerRegistrations)
{
	container.Register(Classes.FromAssemblyInThisApplication(controllerRegistration.Item1).BasedOn<Controller>().Configure(x => x.LifeStyle.Is(controllerRegistration.Item2)));
}

And Ignore ControllerBase Type,I Use this Code For Fix this Problem

foreach (var controllerRegistration in options.ControllerRegistrations)
{
	//container.Register(Classes.FromAssemblyInThisApplication(controllerRegistration.Item1).BasedOn<Controller>().Configure(x => x.LifeStyle.Is(controllerRegistration.Item2)));
	container.Register(Classes.FromAssemblyInThisApplication(controllerRegistration.Item1).BasedOn<ControllerBase>().Configure(x => x.LifeStyle.Is(controllerRegistration.Item2)));
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21

github_iconTop GitHub Comments

1reaction
ghostcommented, Aug 31, 2018

Fixed via #432.

1reaction
ghostcommented, Aug 4, 2018

Aah, I see. Yep I can add them back in and make it use ControllerBase. When I get more time I will pop this in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Castle Windsor: How can I update a components registration
WindsorContainer container = new Castle.Windsor. ... Then before registering your components, you just add the class to your container:
Read more >
Windsor/docs/registering-components-by-conventions.md ...
This is a quick way of adding all your controllers to the container. It will also automatically register all new controllers as you...
Read more >
Building the Castle Windsor Dependency Injection Populator ...
In Castle Windsor, an installer is a class that implements IWindsorInstaller and is used to register all components.
Read more >
Windsor: Beyond Dependency Injection in WPF
In this article, I'll go beyond the basic registering and resolving of components in the Castle Windsor IoC container and into controlling ...
Read more >
Upgrading to Windsor 2.5 (Northwind)
The guide is based on current source from SA repository, and its Northwind sample application. So here we go. We start off by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found