Custom built ASP.NET MVC2 breaks the strongly-typed views
I have a problem with a custom built ASP.NET MVC2. The strongly-typed views break as the viewdata is treated as 'Object' instead of the corresponding type. The same vi开发者_开发技巧ews work perfectly with the default MVC2 from Microsoft.
Finally I found my solution: The whole projects in my VisualStudio-solution were targeted for .NET 3.5 and not 4.0
By simply changing the targeted framework the whole solution compiled and run smooth on the webdev. But the changes had to be made to every single referenced project of the solution - otherwise Visual Studio won't debug into them.
Hope I could help someone with this information.
Currently I'm also looking for a solution. In my project all strongly-typed Views have a Model-reference to an Object instead of the defined class.
Even when I create a totally new View there won't be anything than an Object as Model-type.
Maybe these solutions will help you - unfortunately they don't fit my problem.
object Model types in MVC2 using strongly typed view pages problem
h__p://stackoverflow.com/questions/2531729/intellisense-not-working-for-viewmodel-for-mvc2-project-in-asp-net-mvc2-rtw (as a new user I'm only allowed to post one link... )
精彩评论