Ninject InSingletonScope with Web Api RC

后端 未结 3 752
野性不改
野性不改 2020-12-05 03:02

I\'m having some difficulty using Ninject\'s InSingletonScope binding with Web Api RC. No matter how I create my binding, it looks like perhaps Web Api is handling scope/li

3条回答
  •  Happy的楠姐
    2020-12-05 03:56

    @Remo Gloor When I run your code in InMemoryHost of WebAPI and run Integration tests everything works fine and I do have singleton. If I run WebAPI solution inside VS Cassini web server first run is successful and when I click refresh I receive exception : Error loading Ninject component ICache No such component has been registered in the kernel's component container.

    If I return old code with BeginBlock it works in Cassini but IsSingleton not working anymore in integration tests.

提交回复
热议问题