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
NativeMarshallingAttributeAnalyzer and CustomMarshallerAttributeAnalyzer are throwing exceptions when building the runtime repo.
Reproduction Steps
Set dotnet_diagnostic.AD0001.severity = error in eng/CodeAnalysis.src.globalconfig, and run build.cmd
Expected behavior
No errors
Actual behavior
I get lots of errors like the following:
CSC : error AD0001: Analyzer 'Microsoft.Interop.Analyzers.CustomMarshallerAttributeAnalyzer' threw an exception of type 'System.InvalidOperationException' with me
ssage 'Sequence contains no elements'. [C:\Users\svbomer\src\runtime\src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
CSC : error AD0001: Analyzer 'Microsoft.Interop.Analyzers.NativeMarshallingAttributeAnalyzer' threw an exception of type 'System.InvalidOperationException' with m
essage 'Sequence contains no elements'. [C:\Users\svbomer\src\runtime\src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
CSC : error AD0001: Analyzer 'Microsoft.Interop.Analyzers.CustomMarshallerAttributeAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. [C:\Users\svbomer\src\runtime\src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
CSC : error AD0001: Analyzer 'Microsoft.Interop.Analyzers.CustomMarshallerAttributeAnalyzer' threw an exception of type 'System.InvalidCastExceptio
n' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.
INamedTypeSymbol'.'. [C:\Users\svbomer\src\runtime\src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
Actually, this looks like a different bug. I'll include this one in my PR that adds more support for other things to the analyzer, as I'm about to put out the PR for it and the work would conflict.
Activity
jkoritzinsky commentedon Jul 21, 2022
This will be fixed by #72620
sbomer commentedon Jul 21, 2022
I'm still seeing errors like this:
jkoritzinsky commentedon Jul 21, 2022
:( Why did I decide to try to be a kinder citizen in the VS ecosystem and work off of syntax instead of symbols until I can use operations???
I'll take a look
jkoritzinsky commentedon Jul 21, 2022
Also I didn't realize we had AD0001 disabled locally. That will make this much easier to debug
jkoritzinsky commentedon Jul 21, 2022
Actually, this looks like a different bug. I'll include this one in my PR that adds more support for other things to the analyzer, as I'm about to put out the PR for it and the work would conflict.