的Visual Studio 2015年破剃刀智能感知 [英] Visual Studio 2015 Broken Razor Intellisense

查看:285
本文介绍了的Visual Studio 2015年破剃刀智能感知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在安装和修理,然后我的 VS2015 实例后,我仍然无法获得智能(服务器端)在我的MVC观点工作。
我得到的消息提示,只要我在一个会话中打开了第一次的 .cshtml 的文件,并获得给Activitylog文件警告。
在ActivityLog.xml检索错误消息(短版):

After installing and then repairing my VS2015 instance I still cannot get intellisense (server side) to work in my MVC views. I get alerted by message prompt as soon as I open for the first time in a session an .cshtml file and get addressed to the Activitylog file. Error message retrieved in ActivityLog.xml (short version):

System.ArgumentException:项目已添加。键入
  词典:'RazorSupportedRuntimeVersion

System.ArgumentException: Item has already been added. Key in dictionary: 'RazorSupportedRuntimeVersion'

下面是完整版本:

System.Reflection.TargetInvocationException:异常被抛出
  通过调用的目标。 ---> System.ArgumentException:项目
  已经被添加。重点在词典:
  RazorSupportedRuntimeVersion
键补充说:
  RazorSupportedRuntimeVersion在
  System.Collections.Hashtable.Insert(对象键,对象n值,布尔
  补充)在System.Collections.Hashtable.Add(对象键,对象值)
  System.Collections.Specialized.HybridDictionary.Add(对象键,对象
  值)在
  Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(对象
  键,对象属性)在
  Microsoft.VisualStudio.Html.Package.Razor.RazorVersionDetector.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector.GetVersion(ITextBuffer
  textBuffer)在
  Microsoft.Html.Editor.ContainedLanguage.Razor.RazorUtility.TryGetRazorVersion(ITextBuffer
  textBuffer,版本和放大器; razorVersion)在
  Microsoft.Html.Editor.ContainedLanguage.Razor.RazorErrorTagger..ctor(ITextBuffer
  textBuffer)---内部异常堆栈跟踪的结尾---在
  System.RuntimeMethodHandle.InvokeMethod(对象的目标,对象[]
  参数,签名的签名,布尔构造函数)在
  System.Reflection.RuntimeConstructorInfo.Invoke(的BindingFlags
  invokeAttr,粘结剂粘合,对象[]参数,CultureInfo的文化)
  在System.RuntimeType.CreateInstanceImpl(的BindingFlags bindingAttr,
  活页夹粘结剂,对象[] ARGS,CultureInfo的文化,对象[]
  activati​​onAttributes,StackCrawlMark&安培; stackMark)在
  System.Activator.CreateInstance(类型类型,的BindingFlags bindingAttr,
  活页夹粘结剂,对象[] ARGS,CultureInfo的文化,对象[]
  activati​​onAttributes)在System.Activator.CreateInstance(类型类型,
  [对象]参数)在
  Microsoft.Html.Editor.ContainedLanguage.Common.Contained$c$cErrorTaggerProvider'1.CreateTagger[T](ITextBuffer
  textBuffer)在
  Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator'1.GatherTaggers(ITextBuffer
  textBuffer)

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'RazorSupportedRuntimeVersion' Key being added: 'RazorSupportedRuntimeVersion' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.Add(Object key, Object value) at System.Collections.Specialized.HybridDictionary.Add(Object key, Object value) at Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(Object key, Object property) at Microsoft.VisualStudio.Html.Package.Razor.RazorVersionDetector.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector.GetVersion(ITextBuffer textBuffer) at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorUtility.TryGetRazorVersion(ITextBuffer textBuffer, Version& razorVersion) at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorErrorTagger..ctor(ITextBuffer textBuffer) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at Microsoft.Html.Editor.ContainedLanguage.Common.ContainedCodeErrorTaggerProvider'1.CreateTagger[T](ITextBuffer textBuffer) at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator'1.GatherTaggers(ITextBuffer textBuffer)

如果它的任何帮助,我有一些字体颜色定制,并在网络要点,捆扎机和放大器;安装Minifier和Web编译器扩展。

If it's any help, I have some font-coloring customizations, and have the Web Essentials, Bundler & Minifier and Web Compiler extensions installed.

更新:它发生要么当我打开一个现有的Web应用程序或当我从头开始创建一个全新的。
还有的一个实例的 VS2013 安装并在同一台计算机上运行。

UPDATE: it happens either when I open an existing web application or when I create a brand new one from scratch. There's also an instance of VS2013 installed and running on the same machine.

正如你可以从图片上面看到我没有得到任何智能感知可言,也没有任何一种code着色。

As you can see from the pic above I get no intellisense at all, nor any kind of code coloring.

有关如何解决任何线索?
先谢谢了。

Any clue about how to fix it? Thanks in advance.

推荐答案

我通过清除用户数据解决了这个问题。

I solved this problem by resetting the user data

devenv.exe /resetuserdata

和删除我的项目.VS文件夹中。

and remove the ".vs" folder in my project.

这篇关于的Visual Studio 2015年破剃刀智能感知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆