Missing NinjectWebCommon.cs

918 views
Skip to first unread message

Ed Bick

unread,
Jun 16, 2017, 5:06:42 PM6/16/17
to ninject
I have been learning ASP.Net MVC and Ninject via the book Pro-ASP.Net MVC5 Adam Freeman.

I ran through the samples with no issues and now I am trying to create my own app following the pattern and all of the sudden something weird is (not) happening.

Through NuGet I am instructed to add the following packages:

Ninject
Ninject.Web.Common
Ninject.MVC3

Part of the result is that is supposed to add the file NinjectWebCommon.cs to the App_Start folder.  That happened correctly with the sample script initially, but no longer.....that is, it didn't happen with my own app, and then I went to repeat the script directly from the book and again, it did NOT create the file.

I can manually create the file, but there are a couple of lines that don't resolve 

[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(SportsStore.WebUI.App_Start.NinjectWebCommon), "Start")]
[assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(SportsStore.WebUI.App_Start.NinjectWebCommon), "Stop")]

and before I go down the rabbit hole of trying to figure out why, I would request some input as to why this file is not creating on it's own like it used to (I am concerned that something else that should be happening is not).

As additional information, the book is a little dated and there are some version differences as noted below:


Tool/Book version/latest-I'm using version

Ninject / 3.0.1.10   /   3.2.2
Ninject.Web.Common / 3.0.0.7    /   3.2.3
Ninject.MVC3 /3.0.0.6   /  Doesn't exist, used Ninject.Web.Mvc.FluentValidation   3.2.0

Thanks in advance.

Ed

Michael Powell

unread,
Jun 16, 2017, 8:02:46 PM6/16/17
to nin...@googlegroups.com
On Fri, Jun 16, 2017 at 2:33 PM, Ed Bick <edbi...@gmail.com> wrote:
> I have been learning ASP.Net MVC and Ninject via the book Pro-ASP.Net MVC5
> Adam Freeman.

Generally, I wouldn't recommend Ninject for serious use. It's among
the slower DI containers out there, that I know of. I've used Autofac
and am generally happy with it. It performs reasonably well, not the
fastest, of course, but has a full set of features.
> --
> You received this message because you are subscribed to the Google Groups
> "ninject" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ninject+u...@googlegroups.com.
> To post to this group, send email to nin...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ninject.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages