8

I've just rebuilt my machine with a fresh install of Visual Studio 2015. I've also installed the extensions for Web Essentials and Web Compiler but these seem to have caused a problem

Say for example, prior to installing Web Essentials and Web Compiler, if I was editing a Razor view, if the current element was formatted a couple of tabs in, and I pressed enter, the cursor would automatically tab to the correct place.

Working Example:

<ul>
    <li> <!--press enter here-->
        |<!--would put cursor here-->
    </li>
</ul>

Non Working Example:

<ul>
    <li> <!--press enter here-->
|<!--put's cursor here-->
    </li>
</ul>

This as I'm sure you can understand is quite annoying!

I'm pretty sure it's something to do with Web Essentials or Web Compiler because this wasn't a problem before-hand. In addition to this, I am getting the following error on startup:

Error

And this appears to be the culprit in ActivityLog.xml

ERROR Editor or Editor Extension

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.ContainedCodeErrorTaggerProvider1.CreateTagger[T](ITextBuffer textBuffer) at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator1.GatherTaggers(ITextBuffer textBuffer)

Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
  • Have you tried uninstalling the two extensions? Do the problems persist? Have you tried installing only one of the two? – Tamas Nov 11 '15 at 06:54
  • @Tamas-SonarSourceTeam yeah tried that – Matthew Layton Nov 11 '15 at 08:02
  • And did you still have the issues? – Tamas Nov 11 '15 at 08:51
  • @Tamas-SonarSourceTeam I did – Matthew Layton Nov 11 '15 at 09:04
  • It would be nice to know if this problem arises with only one of the products is installed. But its tedious to do full VS uninstall and install to start from a clean slate. So I guess this question boils down to how annoying this problem is to you... – Tamas Nov 11 '15 at 09:23
  • Possible duplicate of [Visual Studio 2015 Broken Razor Intellisense](http://stackoverflow.com/questions/31581666/visual-studio-2015-broken-razor-intellisense) – kri Nov 20 '15 at 21:43

1 Answers1

2

This happend to me today and I fix the problem following the instructions from the accepted answer to this question: Visual Studio 2015 Broken Razor Intellisense

Here is the answer:

I solved this problem by resetting the user data

devenv.exe /resetuserdata

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

Community
  • 1
  • 1
kri
  • 494
  • 1
  • 6
  • 12