Open jkoritzinsky opened 1 year ago
Tagging subscribers to this area: @dotnet/area-meta See info in area-owners.md if you want to be subscribed.
Author: | jkoritzinsky |
---|---|
Assignees: | - |
Labels: | `area-Meta`, `source-generator` |
Milestone: | Future |
cc: @dotnet/area-infrastructure-libraries as I know some of these packages have been considered for moving to dotnet/maintenance-packages.
We have very poor test coverage for these libraries. What is our confidence that we can switch to use source-generated COM interop in a close-to-zero-risk manner? I'd be inclined to leave them as-is unless our confidence is super high and there's a significant benefit to switching.
If the interop team does the switch-over and review, I have high confidence that we can get it right. When we moved over libraries to use LibraryImport
, we moved over many of these libraries. There was some fallout then, but we have also taken the learnings from those conversions and used them to improve the interop source generators to lessen the chance of a break. With source-generated interop, we can get significant perf benefits and remove some complexity from the interactions with the underlying libraries in these APIs.
We can also get good perf improvements by just making the interop usage cleaner, which is much easier to do with source-generated interop as we have much better tooling to guide users to using high-performance interop (instead of something slow that works).
There were a couple customer requests for System.Management with Native AOT in the past and since we don't have built-in COM interop support in Native AOT, source generated COM is the only way to fix this.
https://github.com/dotnet/corert/issues/6728 https://github.com/dotnet/corert/issues/8184
https://github.com/orgs/dotnet/teams/area-infrastructure-libraries as I know some of these packages have been considered for moving to dotnet/maintenance-packages.
Only System.Speech and we never formalized those discussions into a plan. For now, that library will stay in runtime.
I've taken a look at these libraries and determined that there's more work we can do to make the migration easier:
Another user reporting inability to use System.DirectoryServices.ActiveDirectory with native AOT due to built-in COM use: #101882
Internal partner ran into this for System.Management.
Also linking to #61960 that is about System.Management with trimming/AOT and wasn't mentioned here yet. Found it as I was looking for this issue.
We have 4 libraries that are still using runtime-based COM interop. Once main is .NET 9 and main drops support for versions of .NET that will be out of support when .NET 9 releases (so .NET 6 and 7), we can move these libraries to use source-generated COM as they will only target .NET Standard and .NET 8+ and the .NET Standard implementation is a PNSE (PlatformNotSupportedException-throwing) assembly.
wminet_utils.dll
if we're already updating the library to use source-generated COM as most of the point ofwminet_utils
is to assist with the COM interop.