-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Default Blazor WASM project should not produce trim warnings #44845
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for contacting us. We're moving this issue to the |
Just ran into this issue. We wanted to find issues with trimming because the wasm app wasn't keeping some classes. The deluge of warnings is really irritating to work with. |
I agree. E.g. a simple HttpClient.GetFromJsonAsync triggers the warning That is all around. |
That is actually valuable feedback that makes sense as a warning. Because there is actually a way to use this functionality that preserves the correct type info as the warning states. The issue really is with warnings that come from the generated code in Razor files I find. |
|
Thanks for the link. But see: even as part of the Blazor WASM template there is such a call HttpClient.GetFromJsonAsync to get the Weather Data. |
Ah, I see. In that case sure, this is exactly what the issue is 😅 |
|
I gave it a try with the method for JSON Serializer Code generation. That works OK as long as you use only trivial types. But as soon as you use nested types like IEnumerable it doesn't work right away. I didn't want to spend the effort to figure out how to make it work. That should be included in the templates - as requested. With a reasonable, non trivial example. |
Thanks for contacting us. We're moving this issue to the |
Thanks for contacting us. We're moving this issue to the |
Is there an existing issue for this?
Describe the bug
The default project templates for Blazor WASM apps use trimming, but trimming warnings are suppressed by default. Enabling trim warnings shows there are a number of issues with how the API is annotated.
Unfortunately, there isn't guidance available on how to actually (correctly) fix the issues pointed to by these warnings.
Assuming that the application works correctly when trimmed in all cases, it means one or more of:
Expected Behavior
The default project templates (at least) should be able to be published without trim warnings or there should be guidance on how to fix the warnings and point out in the documentation that this is the case (the default template isn't suitable for trimming).
Steps To Reproduce
Exceptions (if any)
All of the following warnings are issued.
.NET Version
7.0.100-rc.2.22477.23
Anything else?
Marginally related: #39839
The text was updated successfully, but these errors were encountered: