Migrating my MVC 3 application to MVC 4

前端 未结 9 2119
难免孤独
难免孤独 2020-12-24 03:08

I really do not know what to do, I\'m following this article that shows how to migrate my MVC 3 application manually .

I followed all the steps but

9条回答
  •  醉话见心
    2020-12-24 03:17

    I assumed you have MVC3 Intranet web application, when upgrade from MVC3 to MVC4 using NuGet, your application now references System.Web.WebPages.Razor Version 2.0.0.0, NOT System.Web.WebPages.Razor Version 1.0.0.0 anymore. Here is my way of resolving the reference.

    There are two places to fix:

    1. In the root web.config,

      
        
          . . .
          
          . . .
        
      
      

    change Version=1.0.0.0 to Version=2.0.0.0

    So your new reference will look like this:

        
          
            . . .
            
            . . .
          
        
    
    1. In the Views folder, there is web.config file. Inspecting this file you will see it references Version 1. Replace the whole web.config file in Views folder with a new web.config file. Make a backup of the old web.config file, just in case. To get a brand new web.config for the Views folder, you create a new MVC4 application for intranet. Go to the Views folder. Copy the Web.Config file from the Views folder of the new application to the Views folder of the broken application.

    Hope it helps!

提交回复
热议问题