simpleinjector / SimpleInjector

An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
https://simpleinjector.org
MIT License
1.21k stars 154 forks source link

Please support for Trim on self-contained apps #972

Open zachcwillson opened 1 year ago

zachcwillson commented 1 year ago

Describe your problem, question, or feature in a clear and concise way. Please make sure you:

Repro steps:

  1. Setup dotnet 7 console app
  2. Add SimpleInjector reference to the csproj
  3. Update csproj with the following: `true true`
  4. Create a Registration.cs file and a few abstractions
  5. Create a Container and register abstractions in Container
  6. In Main, get reference to abstraction.
  7. Run dotnet publish --self-contained --configuration Release
  8. Observe the following warning: C:\Users\{username}\.nuget\packages\simpleinjector\5.4.1\lib\netstandard2.1\SimpleInjector.dll : warning IL2104: Assembly 'SimpleInjector' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [C:\Users\{username}\source\repos\{project}.csproj]
dotnetjunkie commented 1 year ago

Added this feature request to a future milestone.