Skip to content

[.NET 8] <PublishTrimmed> no longers works but throws build process for an infinite loop #94831

@DierkDroth

Description

@DierkDroth

Description

So far I built my ARM64 binary by
dotnet publish -c Release -r linux-arm64 -p:PublishSingleFile=true -p:SelfContained=true -p:PublishReadyToRun=true MyProject.csproj

Here are my project settings:

	<PropertyGroup>
		<OutputType>Exe</OutputType>
		<TargetFramework>net8.0</TargetFramework>
		<VersionPrefix>1.10.14</VersionPrefix>
		<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
		<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
		<EnableNETAnalyzers>False</EnableNETAnalyzers>
		<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
		<PublishTrimmed>true</PublishTrimmed>
	</PropertyGroup>

Turns out <PublishTrimmed>true</PublishTrimmed> no longers works: the build which tools ~3 minutes on .NET 7 now did not terminate the 'optimization phase' after > 9 hours.

What's going wrong and how could I trim my build as before?

Reproduction Steps

Please see above

Expected behavior

Trimming should work with .NET8 as it worked with .NET 7

Actual behavior

Trimming does not work with .NET8 as it worked with .NET 7

Regression?

Yes

Known Workarounds

None

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions