You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TrimApp -> F:\ILLinker\repro\TrimApp\bin\Debug\net5.0\win-x64\TrimApp.dllILLink : error IL1020: No files to link were specified. Use one of '-a|-r|-x' options [F:\ILLinker\repro\TrimApp\TrimApp.csproj]
If I add a project reference to a simple classlib, then linker will actually not fail, but will be given command line where the classlib is treated as the "application assembly" - which leads to deleting the actual app's assembly from the output - producing completely broken app (without failing the build).
The text was updated successfully, but these errors were encountered:
A short-term fix is just to add IntermediateAssembly to TrimmerRootAssembly, but that won't do the right thing for IsTrimmable libraries (it would keep everything in the library). I actually think that TrimmerRootAssembly is a bit broken, and the longer-term fix is to clean up the linker options for rooting assemblies - I filed dotnet/linker#1541 for this.
Long-term, I think the SDK behavior should be:
!IsTrimmable assemblies -> root entire assembly (entry point or not)
IsTrimmableIntermediateAssembly -> root entry point or public surface (for app or library, respectively)
Create a console app named "TrimApp"
Modify
.csproj
like this:Publishing this app with:
dotnet publish -r win-x64 /p:PublishTrimmed=true /p:TrimMode=link
Actually fails:
If I add a project reference to a simple classlib, then linker will actually not fail, but will be given command line where the classlib is treated as the "application assembly" - which leads to deleting the actual app's assembly from the output - producing completely broken app (without failing the build).
The text was updated successfully, but these errors were encountered: