dotnet/roslyn
View on GitHubNavigating to error about missing file shows yellow crash bar
Open
#41,688 opened on Feb 14, 2020
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:
- 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>
- 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.
 at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.OpenDocumentCore(DocumentId documentId, Boolean activate)
 at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.OpenDocument(DocumentId documentId, Boolean activate)
 at Microsoft.VisualStudio.LanguageServices.Implementation.VisualStudioDocumentNavigationService.OpenDocument(Workspace workspace, DocumentId documentId)
 at Microsoft.VisualStudio.LanguageServices.Implementation.VisualStudioDocumentNavigationService.TryNavigateToLineAndOffset(Workspace workspace, DocumentId documentId, Int32 lineNumber, Int32 offset, OptionSet options)
 at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.AbstractTableEntriesSnapshot`1.TryNavigateTo(Workspace workspace, DocumentId documentId, LinePosition position, Boolean previewTab)
 at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.AbstractTableEntriesSnapshot`1.TryNavigateToItem(Int32 index, Boolean previewTab)
 at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.VisualStudioBaseDiagnosticListTable.LiveTableDataSource.TableEntriesSnapshot.TryNavigateTo(Int32 index, Boolean previewTab)
 at Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.AbstractTableControlEventProcessorProvider`1.EventProcessor.PreprocessNavigate(ITableEntryHandle entryHandle, TableEntryNavigateEventArgs e)
 at Microsoft.VisualStudio.Shell.TableControl.Implementation.TableControlEventManager.<>c__DisplayClass40_0.<OnEntryElementNavigate>b__2(ITableControlEventProcessor p, ITableEntryHandle entry)
 at Microsoft.VisualStudio.Shell.TableControl.Implementation.TableControlEventManager.<>c__DisplayClass60_1`1.<EventProcessorHandler>b__0()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)
--- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>