Set up:
New MVC 3 project, using existing database. Created an EF file (edmx), used the automatic generator to create the POCO classes and DbContext, then deleted the edmx.
Scaffolded a number of controllers and views, using -Repository -Force -Area -ModelType flags from the Package Manager Console command line.
Problem:
When running the app I get the following error:
External Component has thrown an exception.
开发者_开发知识库Right. Fat lot of use. Stopped and started Cassini. No joy. Closed and opened VS2010. No joy.
Can't think what else can be wrong. No one else seems to have the problem (according to Google).
Question:
What the heck is wrong?! Any suggestions?
OK, I restarted the computah and the problem went away.
Just like that.
As if by magic.
First thing I should've tried, isn't it?
|||||||||||
0 0
|
vvvvvvvvvvv
___________
^^^^^^^^U^^
(Self portrait of the Web Developer as an aging man)
Three hours of my life. Vaporised. No page, no pay. No pay, no dinner. No dinner, no web developer. No web developer, no page. The circle of life and death. Ying and Yang. The Tao.
Should've carried on doing Mathematical Physics. At least no one is to blame when the Universe doesn't do what the client expects.
In case it helps anyone: I had this problem and found an error in a bug partial view. After fixing the bug in the partial, the error went away.
It happens when inside View1 you render @Html.Partial(View2, model) and pass a viewmodel that the View2 does not acccept (at least when the viewmodel is templated).
精彩评论