I know this issue has been reported before, but not with Update 3 from what I see:
https://github.com/aspnet/Tooling/issues/276
https://github.com/aspnet/Tooling/issues/390
Stackoverflow:
http://stackoverflow.com/questions/34155654/visual-studio-cannot-open-cshtml-files
http://stackoverflow.com/questions/31581666/visual-studio-2015-broken-razor-intellisense/32376450#32376450
http://stackoverflow.com/questions/34094600/cannot-open-cshtml-files-in-visual-studio-2015
I also tried all possibles fixes from above but no succes :(
The problem is that I can not open any .cshtml file, when I try to open it I get:


In ActivityLog.xml
<entry>
<record>716</record>
<time>2016/08/24 12:02:15.416</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.
 at Microsoft.VisualStudio.Web.Editors.Razor.TagHelpers.TagHelperDescriptorExternalChangeDetector.ConnectRestoreEvents(IVsHierarchy hierarchy)
 at Microsoft.VisualStudio.Web.Editors.Razor.TagHelpers.TagHelperDescriptorExternalChangeDetector.OnFinishInitialization(RazorEditorParser razorParser)
 at Microsoft.Web.Editor.Services.ServiceManager.AdviseServiceAdded[T](IPropertyOwner propertyOwner, Action`1 callback)
 at Microsoft.VisualStudio.Web.Editors.Razor.TagHelpers.TagHelperDescriptorExternalChangeDetector..ctor(ITextBuffer textBuffer)
 at Microsoft.VisualStudio.Web.Editors.Razor.TagHelpers.TagHelperDescriptorResolver..ctor(ITextBuffer textBuffer)
 at Microsoft.VisualStudio.Web.Editors.Razor.RazorHost.Initialize(ITextBuffer textBuffer, String virtualPath)
 at Microsoft.VisualStudio.Web.Editors.Razor.ShimRazorEditorParserImpl.GetRazorWebPageRazorHost(String virtualPath, String physicalPath)
 at Microsoft.VisualStudio.Web.Editors.Razor.ShimRazorEditorParserImpl..ctor(String virtualPath, String physicalPath, ITextBuffer textBuffer)
 at Microsoft.VisualStudio.Web.Editors.Razor.RazorCodeGenerator.FinishInitialization(ITextBuffer buffer, String physicalPath, String virtualPath)
 at Microsoft.VisualStudio.Web.Editors.Razor.RazorCodeGenerator.Create(ITextBuffer buffer, String physicalPath, String virtualPath)
 at Microsoft.VisualStudio.Web.Editors.Razor.RazorCodeGeneratorProvider.Microsoft.Html.Editor.Razor.IRazorCodeGeneratorProvider.CreateRazorCodeGenerator(ITextBuffer buffer, Version razorVersion, String physicalPath, String virtualPath)
 at Microsoft.Html.Editor.Razor.RazorCodeGeneratorFactory.CreateCodeGenerator(ITextBuffer buffer, Version razorVersion, String physicalPath, String virtualPath)
 at Microsoft.Html.Editor.ContentType.Handlers.RazorContentTypeHandler.Init(HtmlEditorTree editorTree)
 at Microsoft.Html.Editor.Document.HtmlEditorDocument..ctor(ITextBuffer textBuffer, IWebWorkspaceItem workspaceItem, Boolean disableContainedLanguages)
 at Microsoft.VisualStudio.Html.Package.Document.VsHtmlEditorDocument..ctor(IWebEditorInstance editorInstance, Boolean disableContainedLanguages)
 at Microsoft.VisualStudio.Html.Package.Commands.Html.VsHtmlTextViewConnectionListener.HtmlDocumentFactoryProjectionsDisabled.CreateDocument(IWebEditorInstance editorInstance)
 at Microsoft.Html.Editor.EditorFactory.HtmlEditorInstance..ctor(IWebWorkspaceItem workspaceItem, ITextBuffer diskBuffer, IWebEditorDocumentFactory documentFactory)
 at Microsoft.Html.Editor.EditorFactory.HtmlEditorFactory.CreateEditorInstance(IWebWorkspaceItem workspaceItem, Object textBuffer, IWebEditorDocumentFactory documentFactory)
 at Microsoft.VisualStudio.Html.Package.Commands.Html.VsHtmlTextViewConnectionListener.InitEditorInstance(ITextBuffer textBuffer)
 at Microsoft.VisualStudio.Html.Package.Commands.Html.VsHtmlTextViewConnectionListener.OnTextBufferCreated(ITextBuffer textBuffer)
 at Microsoft.Web.Editor.Controller.TextViewConnectionListener.SubjectBuffersConnected(IWpfTextView textView, ConnectionReason reason, Collection`1 subjectBuffers)
 at Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.<>c__DisplayClass4_1.<.ctor>b__1()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
</entry>
<entry>
<record>717</record>
<time>2016/08/24 12:02:15.651</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.
 at Microsoft.VisualStudio.Web.Editors.Razor.TagHelpers.TagHelperDescriptorResolver.OnClose(Object sender, EventArgs e)
 at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
 at Microsoft.Html.Editor.Document.HtmlEditorDocument.Close()
 at Microsoft.VisualStudio.Html.Package.Document.VsHtmlEditorDocument.Close()
 at Microsoft.Html.Editor.Document.HtmlEditorDocument.Dispose(Boolean disposing)
 at Microsoft.Html.Editor.Commands.HtmlTextViewConnectionListener.OnTextBufferDisposing(ITextBuffer textBuffer)
 at Microsoft.VisualStudio.Html.Package.Commands.Html.VsHtmlTextViewConnectionListener.OnTextBufferDisposing(ITextBuffer textBuffer)
 at Microsoft.Web.Editor.Controller.TextViewConnectionListener.CheckForViewlessTextBuffers()
 at Microsoft.Web.Editor.Controller.TextViewConnectionListener.SubjectBuffersDisconnected(IWpfTextView textView, ConnectionReason reason, Collection`1 subjectBuffers)
 at Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.<>c__DisplayClass5_1.<Close>b__1()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
</entry>
The problem is: I already completely reinstalled Visual Studio 2015 Update 3 (which took me about 2 days)
I cleaned literally everything. I used https://github.com/Microsoft/VisualStudioUninstaller and did a manual cleanup (AppData Local & Roaming, ProgramData, Program Files, Register)
So I have a fresh install, and still I can not open .cshtml files
My setup:
Microsoft Visual Studio Enterprise 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01055
...
Visual C# 2015 00322-90150-00888-AA715
Microsoft Visual C# 2015
...
ASP.NET and Web Tools 2015.1 14.1.20810.0
ASP.NET and Web Tools 2015.1
ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563
ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/
...
Microsoft .NET Core Tools (Preview 2) 14.1.20810.0
Microsoft .NET Core Tools (Preview 2)
@jodavis can you have someone take a look?
After some resets (/ResetSettings) and uninstalling extensions it worked.
Very weird, I'm 100% confident that my installation was new and fresh
@GerjanOnline, What exactly did you do to solve this as I am currently having the same issue.
I am also having this issue. Any updates on how to resolve?
@herremig, the following the answer from here https://github.com/aspnet/Tooling/issues/276 did helped me:
"A less intrusive solution than fspezi's one is:
Close VS
Delete the content of %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Open VS
"
@nikaburu Thank you, this solved it for me!
tanks Nika very nice solution
Not sure how this happens, but thanks @nikaburu for fix.
Had an "unexprected error". Did a repair - took a few hours - and got a better description of the error, googled it an came here. All the files in the folder %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache seemd to be very recent. Deleted them, though, and the error was gone.
I got the error when I double clicked a .vbhtml file and when I wanted to create a new view from the context menu in the controller.
Worked for me @nikaburu Great result
As @nikaburu said, it solved for me!
Close VS
Delete the content of %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Open VS
Thanks.
I am with the same problem
and delete the ComponentModelCache don't solve for me
Most helpful comment
@herremig, the following the answer from here https://github.com/aspnet/Tooling/issues/276 did helped me:
"A less intrusive solution than fspezi's one is:
Close VS
Delete the content of %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Open VS
"