Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeLoadException when testing analyzer running Roslyn 2.3.2 #1199

Open
bjornhellander opened this issue Jan 3, 2025 · 2 comments
Open

TypeLoadException when testing analyzer running Roslyn 2.3.2 #1199

bjornhellander opened this issue Jan 3, 2025 · 2 comments

Comments

@bjornhellander
Copy link

I get this exception when running analyzer tests against Roslyn 2.3.2:

System.TypeLoadException: 'Method 'RegisterOperationBlockStartActionInternal' on type 'CustomAnalysisContextImpl' from assembly 'codeAnalysisProxies_af0f5d57-e957-457a-bcb7-9146cf3acf3b, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is overriding a method that is not visible from that assembly.'

Image

I have created a solution using the analyzer template: https://github.com/bjornhellander/RoslynAnalyzerWithV232Problem
The tests pass until the last commit where I downgrade the Roslyn packages to version 2.3.2.

Tested with version 1.1.2 of the Microsoft.CodeAnalysis.CSharp.*.Testing packages.

@bjornhellander
Copy link
Author

bjornhellander commented Jan 5, 2025

This seems to happen with the early 2.x versions of Roslyn

@bjornhellander
Copy link
Author

bjornhellander commented Jan 5, 2025

These versions of the AnalysisContext class has some internal methods that can not be overridden this way. Would it be enough to only handle the public methods?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant