jstedfast/MimeKit

Make more packages conditional based on TFM

thompson-tomo opened this issue · 3 comments

Is your feature request related to a problem? Please describe.

I want to minimise dependencies in my project by utilising framework dependencies wherever possible

Describe the solution you'd like

The following packages should not be included in net 8.0

  • System.Runtime.CompilerServices.Unsafe
  • System.Text.Encoding.CodePages

It should be determined which one's should be included in net 6 & net standard 2.1, with my feeling being both can be removed, and some additional one's in 2.1

Describe alternatives you've considered

Accept the additional dependency

Additional context

n/a

Do you have documentation that shows those aren't needed?

@jstedfast the easiest way I have found to check what is included by the base framework, is to expand the framework reference in visual studio and from there you can see what libraries the framework provides.

Those framework references are the reason you don't need to add any references to enable file system etc.

You can also refer to https://learn.microsoft.com/en-us/aspnet/core/fundamentals/target-aspnetcore

Note I have done such a clean up for Elastic, rabbitmq hot chocolate etc.

They needed to be removed for net6.0 as well so I just commit my own patch.

Thanks for bringing this to my attention and offering a PR, though!

(Also sorry for taking so long to get to this, I've just been so busy on weekends)