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

Add Source Generator to Compilation from NuGet Package #1096

Open
HavenDV opened this issue May 17, 2023 · 2 comments
Open

Add Source Generator to Compilation from NuGet Package #1096

HavenDV opened this issue May 17, 2023 · 2 comments
Labels
Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing feature-request This issue tracks implementing a new feature

Comments

@HavenDV
Copy link

HavenDV commented May 17, 2023

For now, I'm using the Microsoft.CodeAnalysis.Testing and ReferenceAssemblies class to resolve packages and add them to Compilation. But this does not work for packages that contain source code generators. Is there a way to add source code generators from a NuGet package using Roslyn or Testing packages?

@HavenDV
Copy link
Author

HavenDV commented May 17, 2023

I guess I need to re-extract the NuGet archives myself, check the analyzers folder for dlls, open them, extract all generator classes, and use CSharpGeneratorDriver to update Compilation.
I just want to make sure it's not already implemented

@sharwell sharwell added Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing feature-request This issue tracks implementing a new feature Feature Request and removed feature-request This issue tracks implementing a new feature Feature Request labels May 17, 2023
@Youssef1313
Copy link
Member

Should the generator added from NuGet package contribute to the expected generated sources? If yes, it will be quite breaking. Maybe a flag should be added along with this? In this case, this will be a sufficient solution for #1087 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing feature-request This issue tracks implementing a new feature
Projects
None yet
Development

No branches or pull requests

3 participants