Reduced VS 2017 IDE interactivity in MVC 5 Razor v

2019-06-23 02:42发布

I just installed VS 2017 and am opening an MVC 5 project created in VS 2015. The application runs fine, but I am experiencing reduced interactivity between my MVC Razor view code and the 2017 IDE.

Here's is the context menu when I right-click on an HTML helper method in VS 2015:

enter image description here

However, I only see this in 2017:

enter image description here

Also notice the lack of syntax color-coding in the 2017 verison. It's like it's not recognizing Razor syntax at all.

I did not do any special solution/project upgrades. I just opened the solution in 2017 and expected it to prompt me to upgrade any files that needed upgrading.

3条回答
不美不萌又怎样
2楼-- · 2019-06-23 02:53

Repair your Visual Studio installation. This happened to me as well.

查看更多
可以哭但决不认输i
3楼-- · 2019-06-23 02:58

So it turns out that the component installation for VS 2017 is modular in that you have to install exactly what you need. This is different from 2015 (at least as far as I recall) where all components are included with the installation.

I have a tendency not to read entire pages and just focus on what seems like the "most comprehensive" option. In my case, I selected only Universal Windows Platform development (doesn't that just sound like everything you'd need?). If I bothered to look at all the components, I would have seen ASP.NET and web development.

So, after modifying my installation, I am now seeing all the Razor syntax in my views.

查看更多
贪生不怕死
4楼-- · 2019-06-23 03:00

Go to Tools Options and customize menus and ribbons

also have a look: https://msdn.microsoft.com/en-us/library/wdee4yb6.aspx

and or: https://msdn.microsoft.com/en-us/library/wdee4yb6(v=vs.110).aspx

try reset the existing window layout or menus and options.

or repair your VS

查看更多
登录 后发表回答