for common use cases, avoid distributing System.Reflection.MetadataLoadContext dlls and deps. #15170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This PR makes two changes
System.Reflection.MetadataLoadContext.dllis still brought into the bin folder fromDynamoPackagesand it's still necessary, this binary is not part of the runtime.DynamoServicesnuspec so that by default whennet8project the SRMLC runtime assets are not copied. This makes it so clients won't have these binaries in their bin folders by default.netstd2project the dependencies are copied as it's possible the developer is targeting an environment where these binaries are not included in the runtime. (net48). I think the value of this is limited for reasons I will get into below.The method that references
MetadataLoadContextis currently private and so are all the methods that invoke that method. It's unlikely that anyone will find themselves in a position requiring this type or needing it at runtime via JIT by just referencing theDynamoServicespackage. For the moment I think this change is okay, but it's not clear yet what use cases it really supports.I think the most important use case to make simple and straightforward is the ZT node author writing nodes for Dynamo 3.x. From that perspective, I think this change is good, it notes the dependency, but does not copy the binaries by default making loading of their packages less fraught (IMO anyway).
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Updates
DynamoServicesNuGet Package with references toSystem.Reflection.MetadataLoadContext