We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following code (where C:\code\roslyn-sdk is a path to checked out dotnet/roslyn-sdk):
C:\code\roslyn-sdk
var manager = new AnalyzerManager(); var analyzer = manager.GetProject(@"C:\code\roslyn-sdk\samples\CSharp\SourceGenerators\GeneratedDemo\GeneratedDemo.csproj"); AdhocWorkspace workspace = new AdhocWorkspace(); Project roslynProject = analyzer.AddToWorkspace(workspace); foreach (var analyzerReference in roslynProject.AnalyzerReferences) { Console.WriteLine(analyzerReference.FullPath); }
This does not print anything; roslynProject.AnalyzerReferences is empty.
roslynProject.AnalyzerReferences
What I expect is that it prints references to source generator assemblies used by the project:
C:\Users\PetrOnderka\.nuget\packages\csvtextfieldparser\1.2.2-preview\lib\netstandard2.0\CsvTextFieldParser.dll C:\Users\PetrOnderka\.nuget\packages\handlebars.net\1.10.1\lib\netstandard2.0\Handlebars.dll C:\Users\PetrOnderka\.nuget\packages\newtonsoft.json\12.0.1\lib\netstandard2.0\Newtonsoft.Json.dll C:\code\roslyn-sdk\artifacts\bin\SourceGeneratorSamples\Debug\netstandard2.0\SourceGeneratorSamples.dll
I plan to submit a PR that fixes this soon.
The text was updated successfully, but these errors were encountered:
Cool! Never even considered adding analyzers and generators to the workspace, but if Roslyn tracks them it definitely makes sense to add them.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Consider the following code (where
C:\code\roslyn-sdk
is a path to checked out dotnet/roslyn-sdk):This does not print anything;
roslynProject.AnalyzerReferences
is empty.What I expect is that it prints references to source generator assemblies used by the project:
I plan to submit a PR that fixes this soon.
The text was updated successfully, but these errors were encountered: