8

I've been having a very difficult time finding an easy to follow tutorial or example of using the interception extension with Ninject, or ideally, a working example.

I've tried the below tutorial, but immediately had problems getting namespaces to work for the Intercept() call:

http://innovatian.com/2010/03/using-ninject-extensions-interception-part-1-the-basics/

David
  • 660
  • 7
  • 18

2 Answers2

4

Have a look at the unittests that come with the source code. There is an example for each feature of the extension: https://github.com/ninject/ninject.extensions.interception/tree/master/src/Ninject.Extensions.Interception.Test

Remo Gloor
  • 32,665
  • 4
  • 68
  • 98
2

I ran into this issue with the tutorial you linked as well. I was able to figure out the namespace you need to import is Ninject.Extensions.Interception.Infrastructure.Language;

Also, you need to reference either the Ninject.Extensions.Interception.DynamicProxy or Ninject.Extensions.Interception.LinFu implementation as well as the Ninject.Extensions.Interception package (and all dependencies). It worked like a charm after that for me.

BlakeH
  • 3,354
  • 2
  • 21
  • 31