Target schema for validation - missing in VS 2012 intellisense - how to resolve?

醉酒当歌 提交于 2019-12-25 16:59:30

问题


In a MVC4, razor view, I am unable to get HTML5 intellisense.

After adding AngularJS references to VS2012 for intellisense, I still wasn't getting the any of the AngularJS directives to appear.

I have the HTML5 schema enabled (Tools/Options/Text Editor/HTML).

I also don't see any of the HTML5 intellisense as shown here.

When I type the

<

Intellisense is "text".

Other tags show a green line with the message "Validation ($SCHEMA$): Element 'script' is not supported.

Looks like there's a disconnect somewhere with my schemas.

I also tried added the target schema for validation to the toolbar and received the error:

---------------------------
Microsoft Visual Studio
---------------------------
Could not complete the action.
---------------------------
OK   
---------------------------

How can I resolve this?


回答1:


I have had exactly the same problem with VS 2013. I had been messing about with the schemas used for validation, so I reckoned that was the problem, turns out I had likely corrupted one of the files.

Find a "healthy" install of VS 2012 (maybe install on another machine?), zip & copy the following directory:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html

Delete the directory from the "unhealthy" VS and copy the "healthy" one into it's place. Then re-start VS.

For 2013, you may also need to do the same for the following directory:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\Web\Schemas\1033\HTML

Prior to this I had also done a "Devenv.exe /Setup" and "Devenv.exe /ResetSettings", but I don't think these are necessary.



来源:https://stackoverflow.com/questions/21051587/target-schema-for-validation-missing-in-vs-2012-intellisense-how-to-resolve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!