-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Failure to preserve types enhancements #34734
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
Conversation
You can find many examples of To see if your file was noticed or not, you can make it invalid xml and you should get fail. If nothing happened, somehow your TrimmerRootDescriptor didn' work. I don't know if Trimmer team prefers attributes over XML, because they don't have those problems. The last option of using custom type instead is probably poor workaround, do we know why we say that ? |
@pavelsavara ... No luck here this morning. Let's take these one at a time ... Breaking the XMLThe first thing is breaking the XML to get an error to know if the file is being found. I took the opening Method signatureI'm not sure what it should be. Nothing I've tried has worked. I'll leave it on the PR for now as ... <method signature="System.Void .ctor(System.String,System.String)" /> ... and that might be incorrect. However, we don't even know if my descriptor file is being picked up yet. If not, then all of my testing on method sigs was a waste of time. Custom type
It came from Javier here ... dotnet/aspnetcore#52947 (comment) I'm going to update that section to say that it will work but that we don't recommend the approach. |
It means it's not being noticed by the msbuild scripts. Do you have it in |
I do ... <ItemGroup>
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
</ItemGroup> |
... with a broken file ... <assembly fullname="System.Runtime">
<type fullname="System.Collections.Generic.KeyValuePair">
<method signature="System.Void .ctor(System.String,System.String)" />
</type>
</assembly>
</linker> ... and when I publish, I have my publish profile set up to delete all files before publishing ... If you want, I can put the project up in a GH repo. |
yes |
🐀🍔 Roasted Rat Burgers! 🐀🍔Ok ... I just made a major discovery here. The project that I'm using is a per-component BWA. I had the descriptor file set up in the server project 🙈 and just discovered that it has to be in the Let me try again now that I know what I was doing wrong. I'll get back to you in a bit ..................... |
Yeah ... that seems ok now. I did get the broken XML file warning, fixed the file, and now it seems to be picking it up. Next quesiton tho ... what is the correct method signature for the It isn't ... <method signature="System.Void .ctor(System.String,System.String)" /> 💥
... and not ... <method signature="System.Void .ctor(TKey,TValue)" /> I can keep trying with brute force, but I'll wait for you to advise me the format of the signature for this. |
Try which of them works, with or without params. |
They both fail with ...
|
|
The error during build went away, but the component is still throwing ...... crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] |
Why this is not working for you dotnet/runtime#102850 Maybe for Net8 and older @javiercn 's advice to use custom type is necessary fallback. |
Correct ... 9.0 app. Do you want me to place the custom type back for <=8.0, or should this only have the |
... so the fix is really going to be for .NET 10? ... I say so because the original issue is still open at ... ... marked for .NET 10 and apparently covered by ... If so, then we only have the This is very confusing! 😆 |
Now I understand more: There are 2 levels to this problem
In dotnet/runtime#112216 Larry suggest to make trimming much less aggressive, which will probably solve both issues. This is only for Net 8 I believe that after dotnet/runtime#102850 rooting the ctor 1) will also keep names 2) |
I see.
I just put it up here .... https://github.com/guardrex/BlazorTrimmerTesting You say a new issue, but dotnet/aspnetcore#52947 is still open. Seems like they just wouldn't close that one and keep working on it. UPDATE: I added a comment to the open issue. |
I've noted in the article text using my tracking moniker (" |
Does the |
Yes, it does. |
Fixes #34654
Pavel ... Could you take a look at this one?
Two of the approaches work as I describe.
One approach, the Root Descriptor approach, I can't get to work using several permutations of assembly, type, and method ... assembly only ... assembly and method only ... or all three. If it won't be easy to figure out why this approach isn't working, should we merge with just the
[DynamicDependency]
attribute approach and the custom type approach? If so, I'll clip the Root Descriptor approach out of this, and I'll make a tracking item entry to try again to cover it some other time.Internal previews