InvalidCastException is thrown after installing ASP.NET MVC 4 Beta

前端 未结 9 1664
小鲜肉
小鲜肉 2020-12-25 09:29

I get the following exception after installing ASP.NET MVC 4 Beta on a machine with ASP.NET MVC 3.

System.InvalidCastException was unhandled by user c

9条回答
  •  忘掉有多难
    2020-12-25 09:51

    1. In Visual Studio, create a new "throwaway" ASP.NET MVC 4 Application in a separate folder somewhere.
    2. Replace the web.config file in your Views folder with the freshly created Views web.config file from the new throwaway application.

    You will notice:

    System.Web.WebPages.Razor changes from Version=1.0.0.0 to Version=2.0.0.0 System.Web.Mvc changes from Version=3.0.0.0 to Version=4.0.0.0

提交回复
热议问题