简体   繁体   中英

Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0 or one of its dependencies. The system cannot find the file specified

I'm working on an old MVC project which uses.aspx views. Whenever I run the code I get this runtime error.

运行时错误

I have checked the references and added System.Web.WebPages.Razor version 2.0.0.0 since I'm unable to find the version mentioned here.

添加参考版本 2.0.0.0

Also, I have added DependentAssembly to the web.config file like below.

web.config 更改

But I'm still getting this error and even in the aspx pages I can see this issue. Can someone help me with this? I tried adding asp.net.webpage from NuGet. But I couldn't find it.

查看错误

Thanks inadvance.

If someone is still looking for an answer for this issue just install ASP.NET MVC 3 RTM framework from here MVC3 framework and that will fix the issue. Once you install it you should be able to see below programs installed under AddOrRemove program (control panel -> program and features)

包裹

Sorry about not to updating the answer soon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM