I'm trying to build NLog in Visual Studio 2019 (Community edition, if that's relevant). NLog is not building due to the casting error below. I've searched the code for the "TypeParameterSymbol" class and its interface for clues, but no luck. I've tried also in VS2022 and bumping it up to net4.8 but always get some version of this error.
I've never seen a build error like this before. What's going on?
Error AD0001 Analyzer 'ILLink.RoslynAnalyzer.RequiresUnreferencedCodeAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. NLog (net46)
Was expecting NLog.dll to build.