roslyn-sdk icon indicating copy to clipboard operation
roslyn-sdk copied to clipboard

Testing Generators with Exposed MSBuild Properties

Open dansiegel opened this issue 1 year ago • 2 comments

Description

Some Generators require access to MSBuild properties to have additional context to be able to properly generate. How can I inject values into the Generator Test so that the generator can access properties that would normally be provided from MSBuild:

context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.SomeProperty", out var value);

dansiegel avatar Sep 16 '24 03:09 dansiegel