0

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.

1
  • Is there a reason you're trying to build NLog yourself instead of using a NuGet package? Commented Sep 21, 2023 at 0:30

1 Answer 1

1

You're likely being impacted by this bug. Try upgrading your SDK and see if that helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.