-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Compiler-generated type as a service #451
Comments
I will look. |
Thank you! 🙏 |
Looks like SettingsSingleFileGenerator tool incorrectly uses Related MSDN blog post: Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute. Unfortunately, there seems to be no way to instruct the tools to avoid emitting the attribute... |
Thanks for the link. It is always good to have a broader look at the problem. |
I'm disappointed that CompilerGenerated attribute doesn't actually mean that the code is compiler-generated. |
Off-topic rant:Code generation story is lost in the details and history now. I would prefer to go to the T4 way of things, but with better tooling and compiler support. |
Hmm, interesting... |
It is mainly about not doing at runtime what can be done at compile-time. Benefits are having compilation errors upfront instead of runtime blow-up. But, the sole usage of compile-time generation in real solutions is a myth. I believe you need both compile and run-time tooling and them being good at playing together to get the max of it. |
Oh, I see, thanks for the insight. |
@yallie What is the name of the class generated from App.settings? |
No, class name is derived from the settings file name: |
Hi Maksim,
I've updated my app to the last version of DryIoc and found that it's not starting up.
The application couldn't resolve its settings class generated from App.settings file.
I found the exact commit where the breaking change was introduced: 2aaedc4
Then I tried to extract the failing setup into a minimal reproducible unit test and it turned out to be tricky.
I was thinking it was the unusual setup (exported static property) that was problematic.
But finally I discovered that the issue was the
CompilerGeneratedAttribute
.I'll create the pull request demonstrating the issue.
Can we disable the rule that ignores the compiler-generated classes as a services?
Does it really help speeding up service resolution?
The text was updated successfully, but these errors were encountered: