Hi @Markus Freitag , Welcome to Microsoft Q&A,
Symbols in a framework are difficult to change.
Judging from the existing rules,
You can use if and elif and else to encapsulate the goals you need.
#if NET7_0_OR_GREATER
output.ProgramId = "xxx";
output.ProgramQty = xxx;
#elifxxx
xxx
#else
output.ProgramId = "xxx";
output.ProgramQty = xxxx;
#endif
If this method doesn't satisfy you, you may be able to manually obtain the version number and make your own judgment.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.