3 steps to resolve cshtml intellisense issue with VS 2015 Update 2

Are you Unable to open .cshtml file on double click. popup a error dialog?


Below steps should solve the problem for you

  1. Close Visual Studio Instances
  2. Delete "C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache"
  3. Re-open Visual Studio
That's all. You should be good to go. However, if you want to read the full story continue :)

I recently updated my VS 2015 Professional to Update 2 and started encountering an issue with .cshtml files. Intellisense wasn't working on these files. 

 Below was the exception registered in Activity Log located in "C:\Users\<username>\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml" 

System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.AppInsights.GettingStarted.CodeLens.ExceptionsDataPointProvider.CanCreateDataPoint(ICodeLensDescriptor descriptor) at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.IndicatorCollection.<>c__DisplayClass13_0.b__0() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call) 

Based on some responses from stackoverflow, I tried disabling "CodeLens". 

Steps for disabling:
  • Go to Tools > Options
  • Select TextEditor > Expand All Languages
  • Click CodeLens > Uncheck "Enable CodeLens"
However, this didn't solve the problem. So, I kept searching for solutions.

Finally I was able to find a similar question asked in https://connect.microsoft.com/VisualStudio/feedbackdetail/view/813896/unable-to-open-cshtml-file-on-double-click-popup-a-error-dialog

And this linked me to the stackoverflow question where I found the solution.

http://stackoverflow.com/questions/14252927/the-operation-could-not-be-completed-invalid-pointer/34329045#34329045 

Additional information is available in below github link
https://github.com/aspnet/Tooling/issues/390

The reason why I wrote this is because people got frustrated and were ready to uninstall  Update 2 and go back to update 1. And this wasn't long back just couple of weeks old

https://social.msdn.microsoft.com/Forums/en-US/2091f5a9-b469-49db-9311-11bb96575179/how-can-i-uninstall-vs2015-update-2-fully-so-i-can-install-vs2015-update-1?forum=vssetup

With all this going, I am really starting to wonder because in our DevOps cycle numerous 3rd party tools, apps and libraries will be included/integrated and with frequent updates releasing for each one of these we will be in state of flux to ensure the environment stability

Comments