I'm using Visual Studio 2017 (Version 15.9.11). I have several Views (cshtml) files which I are from another project, which I have included by using Add->Existing Item->browse to the files->Add as link. For some reason though, when I open one of the files, Visual Studio throw an error dialog which says to check the ActivityLog.xml file for more information. (screenshot below)
Looking at the log, here is what I find.
System.Runtime.InteropServices.COMException (0x80004005):
Error HRESULT E_FAIL has been returned from a call to a COM component.
at Microsoft.VisualStudio.Web.Interop.IVsClientBuildManagerService.DispatchUserWorkItem(IVsClientBuildManagerEventSink sink)
at Microsoft.VisualStudio.Html.Package.CBM.CBMWorkItemDispatcher`1.Dispatch(ITextBuffer textBuffer, Func`1 toExecute, Action`1 callback)
at Microsoft.VisualStudio.Html.Package.Razor.RazorImportsProvider.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorImportsProvider.GetImportsAsync(ITextBuffer textBuffer, Func`1 toExecute, Action`1 callback)
at Microsoft.VisualStudio.Web.Razor.Implementation.Shims.RazorCodeGenerator.DispatchGetRazorNamespacesWorkItem()
at Microsoft.VisualStudio.Web.Razor.Implementation.Shims.RazorCodeGenerator.<.ctor>b__24_0()
at Microsoft.Web.Editor.Utility.GuardedOperations.InvokeExtensionPoint(Object errorSource, Action action)
Can anyone give any insight as to why this is happening, and what I can do to fix it? I have tried cleaning the solution, rebuilding, deleting the ComponentModelCache folder, deleting the csproj.user file, etc. Pretty much everything I could find in other similar posts. However, none have worked.
User contributions licensed under CC BY-SA 3.0