Unable to resolve symbols when additional metadata references are added to the project compilation #104127
Labels
needs-area-label
An area label is needed to ensure this gets routed to the appropriate area owners
untriaged
New issue has not been triaged by the area owner
Version Used:
Microsoft.CodeAnalysis.CSharp.Workspaces
v4.8.0
Microsoft.CodeAnalysis.Workspaces.MSBuild
v4.8.0
In certain cases, I am getting Symbol (
semanticModel.GetSymbolInfo(node.Type).Symbol
) asnull
when usingv4.8.0
with .NET 8.The same works fine with .NET 7.
This only happens in .NET 8 when certain additional metadata references are added to the project compilation. Some types that I noticed causing this are:
When tested with
v4.10.0
, both .NET 7 and 8 return the Symbol asnull
.Steps to Reproduce:
I have created a repo for reproducing this with both .NET 7 and 8:
https://github.com/anto-deepsource/roslyn-symbolinfo-repro
Here, you can notice the Symbol namespacing correctly getting resolved to
Sytsem
in .NET 7, while the Symbol resolves tonull
in .NET 8.Is there any change in the behaviour causing this difference in different versions of .NET and the packages?
Any help in this regard is appreciated.
The text was updated successfully, but these errors were encountered: