When using NinjectMVC3's WebActivator.PreApplicationStartMethod
attribute in my web application,
[assembly: WebActivator.PreApplicationStartMethod(typeof(MyProject.App_Start.NinjectMVC3), "Start")]
I am seeing the following warning in each of my view source editor files:
xxx.cshtml: ASP.NET runtime error: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation.. xxx.cshtml 1 1
it manifests itself as a blue-squiggly on the first line of each of my view files (e.g. a @using
or @model
declaration). Note that the application runs just fine, the problem is only while editing my view source files (visual studio real-time error / warning analysis).
I can verify that WebActivator.PreApplicationStartMethod
is the cause by commenting it out.
How can I fix this?
I'm a little late to this, and just went through this... For me it was because I didn't have a connection string set up. Once I added it, things errors went away.