-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Discrepancy in analyzer behaviour between IDE, msbuild, and MSBuildWorkspace #20373
Comments
👍 If this is intended to increase performance for builds perhaps |
We do this because analyzers can behave differently depending on what context they're running in (see: dotnet/roslyn#20373). This should solve the problem, because as far as I was able to dig into the code, member enumeration is completely lazy and checks that option from `Compilation.Option` all the time. This works in `msbuild`, but Visual Studio seems to override the behaviour. Still working on that... We also just throw completely if the options are not set correctly, as we can't be safe.
I am experiencing an issue like yours when calling Also, Compilation End actions are not being called during live analysis. @heejaechang has said in 2017: #4068 (comment)
Has this been done? No issue was mentioned in the discussion back then. |
Has anyone found a solution for this? I also noticed the discrepancy when running an analyzer/source generator, even with |
Version Used:
Microsoft.CodeAnalysis 1.2.0
Visual Studio 2013 Update 3
Steps to Reproduce:
ITypeSymbol.GetMembers()
on field types.msbuild
/csc
, only public members are picked up.MSBuildWorkspace
, all (private, internal, and public) members are picked up.Expected Behavior:
Not sure. Definitely expect analyzers to do the same thing no matter where they are run, otherwise analysis can differ between whether running in the IDE, building via msbuild, or building via
MSBuildWorkspace
.Actual Behavior:
See (2) and (3).
The text was updated successfully, but these errors were encountered: