Closed kgorro closed 2 years ago
"safe" is an ambiguous term here, so not sure how to answer. That said, take a look at what PluginLoader
is doing under the hood. I chose two sets of behaviors that I thought were sensible defaults. I also provided a lower-level API called AssemblyLoadContextBuilder
which allows you finer grained control to define your own loading behaviors. For example, checkout https://github.com/natemcmaster/DotNetCorePlugins/blob/11cdc4dd58c42e2e80dad636f441a6ef8e26fb9e/src/Plugins/Loader/AssemblyLoadContextBuilder.cs#L114-L195
The issue is when we tried to use the plugin loader with a dotnet profiler which loaded an assembly dynamically causes the application to crash. The main reason for this is that the assembly being loaded by the dotnet profiler is also being loaded by the plugin loader. To solve this we use config.PreferSharedTypes = true
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.
Closing due to inactivity. If you are looking at this issue in the future and think it should be reopened, please make a commented here and mention natemcmaster so he sees the notification.
A dotnet profiler is dynamically loading an assembly which uses types that reference might causes system.io.fileload exception. Is it recommended to use config.PreferSharedTypes = true ? Or Is it possible to have a feature which you can specify a config to exclude an assembly to be loaded in default load context?