Prevent source generator from using ref assemblies #72374
-
It seems like when ref assemblies are enabled for a project, it's not possible for a source generator to get private members from Disabling ref assembly generation for the project is a possible workaround, but it seems not ideal since there may be many such projects to update, and disabling ref assembly completely may negatively impact build performance. So I'm curious if there is a way to just change the behavior in generators to use normal source assemblies instead of ref assemblies. I also posted an issue here providing some details on this: #72369 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found the answer after spending the whole day trying to figure this out... There is a property that can be set on the consuming project to disable ref assembly usage for all projects that it references, so only one place needs to be updated: <CompileUsingReferenceAssemblies>false</CompileUsingReferenceAssemblies> This still affects build performance, although correctness is probably more important, so it sounds like a good tradeoff |
Beta Was this translation helpful? Give feedback.
Found the answer after spending the whole day trying to figure this out... There is a property that can be set on the consuming project to disable ref assembly usage for all projects that it references, so only one place needs to be updated:
This still affects build performance, although correctness is probably more important, so it sounds like a good tradeoff