NinjectWebCommon Throws InvalidOperationException

Exception Details: System.InvalidOperationException: Sequence contains no elements

This error is caused by the fact that there are 2 projects with App_Start/NinjectWebCommon.cs

Removing the file eliminates the error.

Note: if you are nu-getting Ninject.Web.Common because you need to reference Ninject.Web.Common assembly for one of your class library project, you can safely remove the “App_Start” folder and “NinjectWebCommon.cs”.  It is meant for web/web api projects.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s