3

I started a new project today and went to nuget to get ninject.

I downloaded the Ninject MVC3 plugin that should download everything else I need.

I then took some old code from a different project and noticed that InRequestScope seems to be gone.

Was it taken out or am I missing something?

Edit

I think I found it under "Ninject.Web.Common"

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
chobo2
  • 83,322
  • 195
  • 530
  • 832
  • possible duplicate of [Ninject v2.2.1.4 InRequestScope missing](http://stackoverflow.com/questions/6911894/ninject-v2-2-1-4-inrequestscope-missing) – Ruben Bartelink Apr 03 '13 at 12:51

1 Answers1

12

This extension method is defined inside the RequestScopeExtensionMethod class inside the Ninject.Web.Common assembly [which is in a NuGet package with the same name]. This assembly (/package) is automatically referenced when you install the Ninject.NVC3 NuGet package. In order to use it, you need to bring the Ninject.Web.Common namespace in scope:

using Ninject.Web.Common;
Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • 1
    Remeber that you need to install this on the project that your module class is being configured. I had a problem in which I have it installed in the MVC project but the module where I put `Bind<>().To<>().InRequestScope();` was in the Infrastucure project. I took me a while to realize that. – fabriciorissetto Jun 03 '16 at 17:38