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
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
.NET 6.0.200-rtm.22077.13 hits NRE in ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer #2563
A Xamarin.Forms test project started hitting the warning:
CSC warning AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
It seems I can workaround for now, by passing -p:EnableSingleFileAnalyzer=false.
15:26:15.554 1:7>CSC : warning AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. [/Users/runner/work/1/a/TestRelease/01-28_14.45.22/temp/BuildHasNoWarningsFalseTrueTrueapk/UnnamedProject.csproj]
Exception occurred with following context: (TaskId:168)
Compilation: UnnamedProject (TaskId:168)
IOperation: FieldReference (TaskId:168)
SyntaxTree: /Users/runner/work/1/a/TestRelease/01-28_14.45.22/temp/BuildHasNoWarningsFalseTrueTrueapk/App.xaml.cs (TaskId:168)
SyntaxNode: XamlCompilationOptions.Compile [MemberAccessExpressionSyntax]@[90..120) (4,28)-(4,58) (TaskId:168)
System.NullReferenceException: Object reference not set to an instance of an object. (TaskId:168)
at ILLink.RoslynAnalyzer.ISymbolExtensions.HasAttribute(ISymbol symbol, String attributeName) (TaskId:168)
at ILLink.RoslynAnalyzer.RequiresISymbolExtensions.IsInRequiresScope(ISymbol member, String requiresAttribute, Boolean checkAssociatedSymbol) (TaskId:168)
at ILLink.RoslynAnalyzer.RequiresAnalyzerBase.<Initialize>g__CheckCalledMember|19_14(OperationAnalysisContext operationContext, ISymbol member, ImmutableArray`1 incompatibleMembers) (TaskId:168)
at ILLink.RoslynAnalyzer.RequiresAnalyzerBase.<>c__DisplayClass19_0.<Initialize>b__8(OperationAnalysisContext operationContext) (TaskId:168)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info) (TaskId:168)
----- (TaskId:168)
Looks similar to the issue fixed (in main) here: #2534
@agocke should we take #2530 into 6.0.2xx? I wasn't able to confirm definitively whether xamarin-android hit this because of an assembly-level attribute, but I think there's a high chance it's the same issue.
Csc
...
Warnings
CSC warning AD0001: Analyzer 'ILLink.RoslynAnalyzer.RequiresAssemblyFilesAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. [/Users/runner/work/1/a/TestRelease/01-28_14.45.22/temp/BuildHasNoWarningsFalseTrueFalseapk/UnnamedProject.csproj]
Exception occurred with following context:
Compilation: UnnamedProject
IOperation: FieldReference
SyntaxTree: /Users/runner/work/1/a/TestRelease/01-28_14.45.22/temp/BuildHasNoWarningsFalseTrueFalseapk/App.xaml.cs
SyntaxNode: XamlCompilationOptions.Compile [MemberAccessExpressionSyntax]@[90..120) (4,28)-(4,58)
System.NullReferenceException: Object reference not set to an instance of an object.
at ILLink.RoslynAnalyzer.ISymbolExtensions.HasAttribute(ISymbol symbol, String attributeName)
at ILLink.RoslynAnalyzer.RequiresISymbolExtensions.IsInRequiresScope(ISymbol member, String requiresAttribute, Boolean checkAssociatedSymbol)
at ILLink.RoslynAnalyzer.RequiresAnalyzerBase.<Initialize>g__CheckCalledMember|19_14(OperationAnalysisContext operationContext, ISymbol member, ImmutableArray`1 incompatibleMembers)
at ILLink.RoslynAnalyzer.RequiresAnalyzerBase.<>c__DisplayClass19_0.<Initialize>b__8(OperationAnalysisContext operationContext)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)
Thanks @jonathanpeppers. Do you happen to have the BuildHasNoWarningsFalseTrueFalseapk/App.xaml.cs at hand? That would help confirm whether it's hit for an assembly-level attribute. From the stacktrace though, it looks like the same issue.
Activity
sbomer commentedon Jan 28, 2022
Full stacktrace from the build logs:
Looks similar to the issue fixed (in main) here: #2534
jonathanpeppers commentedon Jan 28, 2022
Can that fix go to the
release/6.0.2xxbranch?sbomer commentedon Jan 28, 2022
@agocke should we take #2530 into 6.0.2xx? I wasn't able to confirm definitively whether xamarin-android hit this because of an assembly-level attribute, but I think there's a high chance it's the same issue.
agocke commentedon Jan 28, 2022
Yup, let's do it.
jonathanpeppers commentedon Jan 29, 2022
Sorry it is:
I forgot to attach the
.binlogbefore: illink.zipsbomer commentedon Jan 29, 2022
Thanks @jonathanpeppers. Do you happen to have the
BuildHasNoWarningsFalseTrueFalseapk/App.xaml.csat hand? That would help confirm whether it's hit for an assembly-level attribute. From the stacktrace though, it looks like the same issue.jonathanpeppers commentedon Jan 29, 2022
Yes, it has:
Bump to dotnet/installer@e950d07 6.0.200-rtm.22078.8 (#6670)
Bump to dotnet/installer@e950d07 6.0.200-rtm.22078.8 (dotnet#6670)
Bump to dotnet/installer@e950d07 6.0.200-rtm.22078.8 (#6670)
agocke commentedon Feb 11, 2022
Should have been fixed by #2530
[One .NET] default $(EnableSingleFileAnalyzer) to true again
[One .NET] default $(EnableSingleFileAnalyzer) to true again (#7177)