Last post Jan 01, 2018 05:12 PM by Yossu
Jan 01, 2018 02:51 PM|Yossu|LINK
I have an MVC project that was developed using MVC4 in VS2015. Yesterday, I upgraded it to MVC5 and switched to using VS2017.
The site still runs fine, but when I look in a Razor file, VS marks all sorts of spurious errors. For example, it underlines the word "model" in the following line...
...even though this is part of the MVC framework. Similarly, it underlines "ViewBag" in the following line...
ViewBag.Title = "Tasks";
As I said, everything runs fine, it just shows the errors in the Razor file, and adds them all (quite a lot more besides these) to the Error window.
P.S. Just realised that if I open the solution in VS2015, and look at the same Razor file, it shows the same errors.
Anyone any idea what's going on? Thanks
Jan 01, 2018 04:49 PM|Khanna Gaurav|LINK
Are you able to build the project without any error? Your web.config may require some change
Jan 01, 2018 05:12 PM|Yossu|LINK
Ah, I'd missed changing the version number of some of the references to System.Web.Mvc in the Views/Web.config.
All fixed now, thanks very much.