-
Notifications
You must be signed in to change notification settings - Fork 127
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
NETSDK1144: Optimizing assemblies for size failed .NET 7 #3119
Comments
Could you share any details (e.g. stack trace) of what failed? |
Hi, I cant see any stack trace I just get that error when doing a docker-compose --build #14 102.2 /usr/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.ILLink.Tasks/build/Microsoft.NET.ILLink.targets(133,5): error MSB6006: "dotnet" exited with code 137. [/src/Client/iUWWorkbench.Client.csproj]
|
137 is usually the exit status when a process is terminated by If that's correct, it would be nice for this to show up as an OutOfMemoryException instead, but I don't know enough about OOM hardening in .NET. It would be interesting to experiment with a repro if you are able to share anything. |
Excellent, that's exactly what it was thanks, I bumped the memory in docker and it builds now with PublishTrimmed on. Unfortunately I dont have a demo repo, ill see if I can create one if I get some time this week. thanks again |
@CliveBennett out of curiosity, what was the limit before? |
I went from 2GB to 6GB, (I have 4 .net 6 apps and 2 MySQL db's applications running in Docker). (Just for local development) |
I have the same issue when building xamarin android app using .net7. It works fine when build using .net6. Issue exists only in Release mode with linker configured to link sdk assemblies only.
I have attached 2 solutions, one with .net6 global.json compiles. The one with .net7 global.json fails on the error above. Interesting observation is that if I add class that inherit from Activity in root namespace: using Android.Runtime;
using Core;
using MvvmCross.Platforms.Android.Views;
namespace AndroidApp1;
public class T : Activity
{
}
[Application]
public class MainApplication : MvxAndroidApplication<Setup, App>
{
public MainApplication(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference,
transfer)
{
}
public override void OnCreate()
{
base.OnCreate();
//CrossCurrentActivity.Current.Init(this);
}
} Build works fine. |
I have upgraded a Blazor client app from .net 6 to .net 7
and I'm getting this while building a container image
Error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.
I am using this in my DockerFile
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base
Adding
PublishTrimmed false PublishTrimmed
to the blazor client project file does "fix" the issue, but im not really sure what the actual issue is?
https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/
Refers to the error, with no information.
The text was updated successfully, but these errors were encountered: