You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
One typical code error triggers the correct message as seen in Output
3>D:\JMB\System\VB.net\Net8_DLLs_Tests\JMF_Test_Globals_JMF_Test_Globals.vb(70,19): error BC30266: 'Public Overrides Sub mgrs_newdispose([eND] As jmcore_globals.ND_enum)' cannot override 'Protected MustOverride Sub mgrs_NewDispose([eND] As jmcore_globals.ND_enum)' because they have different access levels.
But in the Error List tab a rather confusing message appears and the error is not reported.
Analyzer 'Microsoft.CodeAnalysis.Diagnostics.VisualBasic.VisualBasicCompilerDiagnosticAnalyzer' threw an exception of type 'System.ArgumentException' with message 'Reported diagnostic 'BC30266' has a source location in file 'D:\JMB\System\VB.net\Net8_DLLs\JMCore\sources JMCore\ZMgrs.vb', which is not part of the compilation being analyzed. (Parameter 'diagnostic')'.
Exception occurred with following context:
Compilation: JMF_Test_PJ
SyntaxTree: D:\JMB\System\VB.net\Net8_DLLs_Tests\JMF_Test_Globals_JMF_Test_Globals.vb
System.ArgumentException: Reported diagnostic 'BC30266' has a source location in file 'D:\JMB\System\VB.net\Net8_DLLs\JMCore\sources JMCore\ZMgrs.vb', which is not part of the compilation being analyzed. (Parameter 'diagnostic')
at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationInCompilation(String id, Location location, Compilation compilation)
at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationsInCompilation(Diagnostic diagnostic, Compilation compilation)
at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyArguments(Diagnostic diagnostic, Compilation compilation, Func3 isSupportedDiagnostic, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.SemanticModelAnalysisContext.ReportDiagnostic(Diagnostic diagnostic) at Microsoft.CodeAnalysis.Diagnostics.CompilerDiagnosticAnalyzer.CompilationAnalyzer.ReportDiagnostics(ImmutableArray1 diagnostics, Action1 reportDiagnostic, Func2 locationFilter, ImmutableDictionary2 properties) at Microsoft.CodeAnalysis.Diagnostics.CompilerDiagnosticAnalyzer.CompilationAnalyzer.AnalyzeSemanticModel(SemanticModelAnalysisContext context) at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
Suppress the following diagnostics to disable this analyzer: AD0001, BC2001, .....very long list
If you are not aware of this error it may be quite misleading.
In my case this happens if a routine declared with "protected" in the base class is overridden with a routine declared Public in the inheriting class
in the inheriting class
Overrides Sub mgrs_newdispose([eND] As ND_enum)
Throw New NotImplementedException() ' there is no sub project in this case (only JMCore)
End Sub
and in the base class
Protected MustOverride Sub mgrs_NewDispose([eND] As ND_enum) Implements IMgr_DLLorPJ.mgrs_NewDispose
This error has been here for a long time.
Thanks in advance
Windows 11 up to date, Visual Studio Preview up to date, Net 8.0. Happens on all VS releases
Original Comments
Feedback Bot on 2/3/2025, 01:13 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
This issue has been moved from a ticket on Developer Community.
Hello
One typical code error triggers the correct message as seen in Output
3>D:\JMB\System\VB.net\Net8_DLLs_Tests\JMF_Test_Globals_JMF_Test_Globals.vb(70,19): error BC30266: 'Public Overrides Sub mgrs_newdispose([eND] As jmcore_globals.ND_enum)' cannot override 'Protected MustOverride Sub mgrs_NewDispose([eND] As jmcore_globals.ND_enum)' because they have different access levels.
But in the Error List tab a rather confusing message appears and the error is not reported.
Analyzer 'Microsoft.CodeAnalysis.Diagnostics.VisualBasic.VisualBasicCompilerDiagnosticAnalyzer' threw an exception of type 'System.ArgumentException' with message 'Reported diagnostic 'BC30266' has a source location in file 'D:\JMB\System\VB.net\Net8_DLLs\JMCore\sources JMCore\ZMgrs.vb', which is not part of the compilation being analyzed. (Parameter 'diagnostic')'.
Exception occurred with following context:
Compilation: JMF_Test_PJ
SyntaxTree: D:\JMB\System\VB.net\Net8_DLLs_Tests\JMF_Test_Globals_JMF_Test_Globals.vb
System.ArgumentException: Reported diagnostic 'BC30266' has a source location in file 'D:\JMB\System\VB.net\Net8_DLLs\JMCore\sources JMCore\ZMgrs.vb', which is not part of the compilation being analyzed. (Parameter 'diagnostic')
at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationInCompilation(String id, Location location, Compilation compilation)
at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationsInCompilation(Diagnostic diagnostic, Compilation compilation)
at Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyArguments(Diagnostic diagnostic, Compilation compilation, Func
3 isSupportedDiagnostic, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.SemanticModelAnalysisContext.ReportDiagnostic(Diagnostic diagnostic) at Microsoft.CodeAnalysis.Diagnostics.CompilerDiagnosticAnalyzer.CompilationAnalyzer.ReportDiagnostics(ImmutableArray
1 diagnostics, Action1 reportDiagnostic, Func
2 locationFilter, ImmutableDictionary2 properties) at Microsoft.CodeAnalysis.Diagnostics.CompilerDiagnosticAnalyzer.CompilationAnalyzer.AnalyzeSemanticModel(SemanticModelAnalysisContext context) at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action
1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)Suppress the following diagnostics to disable this analyzer: AD0001, BC2001, .....very long list
If you are not aware of this error it may be quite misleading.
In my case this happens if a routine declared with "protected" in the base class is overridden with a routine declared Public in the inheriting class
in the inheriting class
Overrides Sub mgrs_newdispose([eND] As ND_enum)
Throw New NotImplementedException() ' there is no sub project in this case (only JMCore)
End Sub
and in the base class
Protected MustOverride Sub mgrs_NewDispose([eND] As ND_enum) Implements IMgr_DLLorPJ.mgrs_NewDispose
This error has been here for a long time.
Thanks in advance
Windows 11 up to date, Visual Studio Preview up to date, Net 8.0. Happens on all VS releases
Original Comments
Feedback Bot on 2/3/2025, 01:13 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Feedback Bot on 2/3/2025, 07:03 AM:
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.
The text was updated successfully, but these errors were encountered: