dotnet/roslyn

Navigating to error about missing file shows yellow crash bar

Open

#41,688 opened on Feb 14, 2020

View on GitHub
 (2 comments) (0 reactions) (1 assignee)C# (4,257 forks)batch import
Area-IDEBughelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

Version Used:

Steps to Reproduce:

  1. Create project like:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>

    <Compile Include="..\..\Shared\NonExistentFile.cs">
    </Compile>

  </ItemGroup>

</Project>

  1. Navigate to:
Severity	Code	Description	Project	File	Line	Suppression State
Error	IDE1100	Error reading content of source file 'C:\Users\davkean\source\repos\Shared\Class1.cs' -- 'Could not find file 'C:\Users\davkean\source\repos\Shared\Class1.cs'.'.	𪛑𪛒𪛓𪛔	C:\Users\davkean\source\repos\Shared\Class1.cs	1	Active

Expected Behavior: No yellow bar

Actual Behavior: Yellow bar:

System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.OpenDocumentCore(DocumentId documentId, Boolean activate)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.OpenDocument(DocumentId documentId, Boolean activate)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.VisualStudioDocumentNavigationService.OpenDocument(Workspace workspace, DocumentId documentId)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.VisualStudioDocumentNavigationService.TryNavigateToLineAndOffset(Workspace workspace, DocumentId documentId, Int32 lineNumber, Int32 offset, OptionSet options)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.AbstractTableEntriesSnapshot`1.TryNavigateTo(Workspace workspace, DocumentId documentId, LinePosition position, Boolean previewTab)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.AbstractTableEntriesSnapshot`1.TryNavigateToItem(Int32 index, Boolean previewTab)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.VisualStudioBaseDiagnosticListTable.LiveTableDataSource.TableEntriesSnapshot.TryNavigateTo(Int32 index, Boolean previewTab)&#x000D;&#x000A;   at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.AbstractTableControlEventProcessorProvider`1.EventProcessor.PreprocessNavigate(ITableEntryHandle entryHandle, TableEntryNavigateEventArgs e)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.TableControl.Implementation.TableControlEventManager.&lt;&gt;c__DisplayClass40_0.&lt;OnEntryElementNavigate&gt;b__2(ITableControlEventProcessor p, ITableEntryHandle entry)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.TableControl.Implementation.TableControlEventManager.&lt;&gt;c__DisplayClass60_1`1.&lt;EventProcessorHandler&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>

Contributor guide