Could not load file or assembly 'System.Web.WebPages'

前端 未结 7 441
孤街浪徒
孤街浪徒 2020-12-20 11:45

I\'ve had this problem before, but then all i needed to do was to clean and rebuild the project. Now that doesnt seem to work anymore. When i start my Asp.Net MVC3 project d

7条回答
  •  粉色の甜心
    2020-12-20 12:19

    I scratched my head for a while over this problem when I had it. Eventually I noticed that I had the following section in the "runtime" section of my web.config.

    
     . . .
          
            
            
          
    . . .
    
    

    As you can see, this refers to version 2 of the assembly, which doesn't match the following code that you also have in the system.web/compilation/assemblies section of web.config.

    
    

    The actual assembly referenced in References for the project is indeed v1.0.0.0, so I changed the first chunk of code above to the following, which fixed the problem immediately. I'm not sure how the mistake got there in the first place.

    
     . . .
          
            
            
          
    . . .
    
    

提交回复
热议问题