dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.96k stars 4.65k forks source link

Support pay-for-play runtime properties/services #3673

Open vitek-karas opened 5 years ago

vitek-karas commented 5 years ago

Currently the only way to pass information between the host and the runtime is the "runtime properties" array. This array is not pay-for-play, all the properties which the runtime will ever know must be in it. This means that if there are properties which are filled by the host itself (like TRUSTED_PLATFORM_ASSEMBLIES), all the applications will pay the price to create the property and pass it to the runtime.

The cost associated with the property is non-zero, there are 3-4 copied of the property names and values made during startup.

It would be beneficial to have a pay-for-play mechanism of getting information from the host, and eventually not just information by entire services. The host could expose useful information (which is useful for a very limited set of apps though), like:

As for services we're already running into this problem today. The AssemblyDependencyResolver relies on services provided by hostpolicy. Today the communication is done via special APIs on hostpolicy, which means the runtime/corelib have hardcoded dependency on hostpolicy itself. This prevents hosts which are not using our hosting libraries unable to provide such services. (This is not very common and in general we encourage users to always rely on our hosting components, but the direct hosting API still exists and is supported).

dotnet-policy-service[bot] commented 3 weeks ago

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.