Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First lets get your project setup with some Windsor installers. They look like this for the most part.</p> <pre><code> public class ServiceInstaller : IWindsorInstaller { public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Component.For&lt;IEncryptionService().ImplementedBy&lt;EncryptionService&gt;()); } } </code></pre> <p>in your App_Start folder add a class called ContainerConfig.cs that could look something like this.</p> <pre><code> public class ContainerConfig { private static IWindsorContainer _container; public static IWindsorContainer ConfigureContainer() { _container = new WindsorContainer(); _container.Install(FromAssembly.This()).Install(FromAssembly.Named("Project.Dependency")); _container.Kernel.Resolver.AddSubResolver(new CollectionResolver(_container.Kernel, true)); _container.AddFacility&lt;TypedFactoryFacility&gt;(); var controllerFactory = new WindsorControllerFactory(_container.Kernel); ControllerBuilder.Current.SetControllerFactory(controllerFactory); return _container; } } </code></pre> <p>Please note that I have a separate project for my Dependency Injection hence the _container.Install(FromAssembly.This()).Install(FromAssembly.Named("Project.Dependency")); line... You can remove the latter .Install(FromAssembly) part.</p> <p>In your Global.asax you can do something like this:</p> <pre><code>protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); ContainerConfig.ConfigureContainer(); } </code></pre> <p>Now in your controllers you can do this:</p> <pre><code> public class TempController : Controller { private readonly IEncryptionService _encryptionService; public TempController(IEncryptionService encryptionService ) { _encryptionService = encryptionService; } public ActionResult Index() { // Example of calling a method on the encryption service. string hash, salt; _encryptionService.GethashAndSaltString("I Need Some Loving", out hash, out salt); return View(); } } </code></pre> <p>Please let me know if you get something working with constructor injection. Solving that issue will be a great help going forward and you won't be using property injection. Once we get all of that sorted out we can look at your webervice issues.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload