Could not load file or assembly System.Web.WebPages.Razor, , Version=3.0.0.0 or one of its dependencies

后端 未结 3 1953
眼角桃花
眼角桃花 2020-12-09 15:56

I am using MVC 5, WCF and Unity framework in my application.

I am getting below error when I run WCF service:

Server Error in \'/\' Application.

Co         


        
相关标签:
3条回答
  • 2020-12-09 16:04

    Be sure that your project targets .net 4.5, that all references are valid and that web AspNet.WebPages.* are in the bin (Release/Debug) folder.

    valid refs

    You may also try to reinstall Microsoft.AspNet.WebPages nuget packages using this command in the package manager console

    > Update-Package –reinstall Microsoft.AspNet.WebPages 
    
    0 讨论(0)
  • 2020-12-09 16:11

    I was encountering the exact error here (among a couple other missing reference errors) on my Win10 x64 system. My issue was (I believe), was caused by uninstalling something from add/remove that ripped out other dlls.

    After scouring the internet for a solution, what finally worked for me was the answer here: https://stackoverflow.com/a/27785999/692124

    Download and install Web Pages Version 2

    0 讨论(0)
  • 2020-12-09 16:29

    I had same issue where WCF was showing error of unrelated MVC assembly (I have multiple MVC projects in solution which are using System.Web.WebPages.Razor, Version=3.0.0.0). I installed Microsoft.AspNet.WebPages package in the WCF project , ran WCF proj and It worked. After that I had uninstalled all Microsoft.AspNet.WebPages related packages. It worked fine.

    0 讨论(0)
提交回复
热议问题