dotnet / dotnet/linker

MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Builder.IApplicationBuilder.set_ApplicationServices

Open
#2,820 7 comments 0 reactions 0 assignees View on GitHub
area-Linker: Steps
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

I wanted to confirm a trimming issue in NativeAOT is caused by a known NativeAOT bug (treating TrimmerDefaultAction=copy same as TrimmerDefaultAction=copyused) but instead of confirming it, I found an illink bug:

```
C:\illinkrepro>dotnet --info
.NET SDK:
Version: 7.0.100-preview.6.22302.2
Commit: b42b660f0b
```

```
dotnet new webapi -o illinkrepro
cd illinkrepro
dotnet publish -r win-x64 -c Release /p:PublishTrimmed=true /p:TrimmerDefaultAction=copyused

C:\illinkrepro>C:\illinkrepro\bin\Release\net7.0\win-x64\publish\illinkrepro.exe
Unhandled exception. System.MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Builder.IApplicationBuilder.set_ApplicationServices(System.IServiceProvider)'.
at Program.$(String[] args)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.