Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebActivator PreApplicationStartMethod not working

I'm making a new project following onin architecture.

enter image description here

I have a separate project called "bootstrapper" that contain IOC and WebActivator.. My problem is that class that contain WebActivator not even loaded in debug ! May be i'm missing something ?

[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(IocConfig), "RegisterDependencies")]
 public class IocConfig
 {
        public static void RegisterDependencies()
        {
            //..........
        }
 }
like image 272
moyomeh Avatar asked Oct 26 '25 04:10

moyomeh


1 Answers

Your Onion.Bootstrapper project corresponds to the outermost layer of your Onion Architecture. It's the only projects that references all the others.

Using WebActivator allows you to avoid having to reference Onion.Bootstrapper in WebApplication. The RegisterDependencies method will be called on pre-application start.

To make this works, the only thing you need to do is to make sure the Onion.Bootstrapper dll is pushed to WebApplication /bin directory ( (easy to set up using a post build action or OutputTo nugget package)).

like image 194
MaxSC Avatar answered Oct 27 '25 17:10

MaxSC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!