InvalidCastException is thrown after installing ASP.NET MVC 4 Beta

前端 未结 9 1652
小鲜肉
小鲜肉 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:59

    I had the same problem, but when migrating ASP.NET MVC 3 to ASP.NET MVC 4. This way I got on this topic. I have found a solution to the problem, but its source is different, it is not from WebPages version.

    I have followed the official guide (so to say) Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4.

    To resolve the problem, you have to add in Web.Config (probably around previously added ones):

    
        
        ..
            ... some other dependecy redirects ...
    
        
            
            
        
    
            ... some other dependency redirects ...
        
    
    

    Also in the notes is not mentioned to change the Reference of System.Web.Helpers from 1.0.0.0 to 2.0.0.0 (delete and add the new one).

提交回复
热议问题