How to use Ninject Conventions extension without referencing Assembly (or Types within it)

前端 未结 2 1507
不知归路
不知归路 2020-12-18 19:35

Sorry in advance for the long question, it\'s long because I\'ve been digging at this all day.

The general problem:

I have an ASP.Net MVC2 application with

2条回答
  •  时光说笑
    2020-12-18 20:27

    I'm not sure if this is a typo in your example, but I did notice that you've written

    kernel.Scan(a => {
        a.From("MyApp.Data");
        // etc.
    }
    

    But shouldn't that be

    kernel.Scan(a => {
        a.From("MyApp.Data.dll")
        // etc.
    });
    

    Because if I include the .dll part in my example project it works, but if I leave it out I receive a FileNotFoundException.

提交回复
热议问题