Source Generators execution order #57912
Unanswered
lentrodev
asked this question in
Show and tell
Replies: 1 comment 2 replies
-
I'm a bit confused by this post -- even though that may control the order in the sense of "which one do we run first", generators will see the same input so the ordering isn't observable short of a debugger.... |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If anyone need to know how to reorder source generators, located in different assemblies, or if you need to be sure your generators will be executed after others, just reorder
Project/PackageReference
s in your targetcsproj
file.For example, we have project
Test
, and two projects with source generators,Test.A
andTest.B
, so ourTest.csproj
file will look similar tothis:
Here, firstly will be executed generators from the
Test.A
project, and then from theTest.B
.Also, will be nice to have feature to order generators in the assemblies, but there's no way to do that at the moment.
Beta Was this translation helpful? Give feedback.
All reactions