-
Notifications
You must be signed in to change notification settings - Fork 128
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
.Net 7 trimmer regression #3160
Comments
We are currently also running into this regression. The odd thing is that all our projects are .NET 6 but when building the .NET 7 SDK ILLink is used. Is that normal?
|
This is expected if you are using the .Net 7 SDK, the linker version matches the SDK version, not the TFM of the project being trimmed. The linker is backwards compatible with projects targeting previous .Net versions. The fix for the regression has made it into the latest release of the .Net SDK (7.0.3), so you should be able to upgrade and no longer hit the issue. If you still want to use the .Net 6 linker, you could either use a global.json file to force the .Net 6 SDK to be used, or use the same workaround as above, but change the package version to be the latest .Net 6.0 release (6.0.406). You also shouldn't need the nuget.config for the .Net 6 version of the package. @sbomer Correct me if my answer is wrong or incomplete. |
I still got out of memory issues with the IL Linker in the 7.0.201 SDK (7.0.3). After adding the Microsoft.Net.ILLink.Tasks package Tip: The package is available on nuget.org, so you don't need the extra dotnet8 packages source anymore. |
@daghsentinel You need to use the 7.0.3xx SDK from dotnet/installer to get the linker with the fix. The SDK 7.0.201 listed under 7.0.3 at https://dotnet.microsoft.com/en-us/download/dotnet/7.0 uses the 7.0.3 .Net runtime, but still uses the old linker. |
My main problem with .NET 7 trimmer is that its poorly document / not obvious how it works compared to .NET 6. If you create WASM from default template: Visual Stuido 2022 -> Blazor WebAssembly App Details on project creationSelect: You get 3 projects: Add to the XYZ.Client: <PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode> Publish -> Folder (Configuration: Release, Target Runtime: Portable, Deploy Mode: Framework-dependent) If you remove Same problems happens if you have |
I got out of memory issues with the IL Linker
doesn't help |
@YuliaLoyko You shouldn't need that PackageReference in the latest version of the .NET 7 SDK. If you are using version 7.0.3 or later of the SDK, this particular issue should be resolved. Ensure you're on the latest SDK version (https://dotnet.microsoft.com/download), and if you still run into issues, please file a new issue with details at dotnet/runtime. |
i use dotnet version 7.0.306 and MtouchLink=SdkOnly should i file new issue? |
Yes, please file a new issue, and if you can include a msbuild binlog by running with |
Update:
This has been fixed in the 7.0.3xx version of the .Net SDK, which is now in preview and can be downloaded from dotnet/installer.
Original:
We have found a number of issues reported from the trimmer that shipped with the .Net 7 SDK. Most of these issues have been addressed in the latest builds but haven't made their way into servicing releases of the .Net 7 SDK. The following issues have been addressed and will be fixed in the .Net SDK version 7.0.3xx:
If you run into an issue related to the above issues, slow trimming, or high memory usage, please try using the latest version of the linker to see if that fixes your issue.
To use the latest version (as of December 12, 2022), add a PackageReference to your .csproj file.
Then, add a nuget.config file if you don't already have one by running
dotnet new nugetconfig
in the same directory as the .csproj. In the nuget.config add the dotnet8 package sources by adding the<add key=...>
line below.The text was updated successfully, but these errors were encountered: