WebActivator preApplicationStartMethod不工作 [英] WebActivator PreApplicationStartMethod not working

查看:356
本文介绍了WebActivator preApplicationStartMethod不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下面应仁之乱架构做一个新项目。

我有一个名为引导程序包含国际奥委会和WebActivator ..我的问题是,包含WebActivator甚至不会加载在调试该类一个单独的项目!可能是我想的东西?

  [装配:WebActivatorEx preApplicationStartMethod(typeof运算(IocConfig),RegisterDependencies)]
 公共类IocConfig
 {
        公共静态无效RegisterDependencies()
        {
            // ..........
        }
 }


解决方案

Onion.Bootstrapper 项目对应于你的洋葱建筑的最外层。这是引用所有其他的唯一项目。

使用 WebActivator 让你避免引用 Onion.Bootstrapper WebApplication的。在 RegisterDependencies 方法将在pre-应用程序启动调用。

为了使这个工作,你需要做的唯一的事情是要确保在 Onion.Bootstrapper dll是被推到的WebApplication / bin中目录((容易建立使用后生成的动作或 OutputTo 的狗头包))。

I'm making a new project following onin architecture.

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()
        {
            //..........
        }
 }

解决方案

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)).

这篇关于WebActivator preApplicationStartMethod不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆