我刚刚重新安装了Visual Studio 2015并安装了Web Essentials和Web Compiler扩展,但这些似乎引起了问题。
例如,如果在安装Web Essentials和Web Compiler之前,我正在编辑Razor视图,如果当前元素格式化了几个制表符,并且我按下回车键,光标会自动移动到正确的位置。
工作示例:
<ul>
<li> <!--press enter here-->
|<!--would put cursor here-->
</li>
</ul>
非工作示例:
<ul>
<li> <!--press enter here-->
|<!--put's cursor here-->
</li>
</ul>
我相信你能理解,这很烦人!
我非常确定这与Web Essentials或Web Compiler有关,因为以前没有这个问题。此外,在启动时我收到以下错误:
而这似乎是ActivityLog.xml中的罪魁祸首
错误 编辑器或编辑器扩展
System.Reflection.TargetInvocationException: 调用目标上抛出了异常。 ---> System.ArgumentException: 项已经添加。字典中的键:“RazorSupportedRuntimeVersion” 正在添加的键:“RazorSupportedRuntimeVersion” 在 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) --- 内部异常堆栈跟踪的结尾 --- 在 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)