在运行时的.NET 4“useLegacyV2RuntimeActivati​​onPolicy”?NET、useLegacyV2RuntimeActivati、onPolicy

2023-09-05 02:07:18 作者:败给可爱

是否有可能在运行时设置的app.config useLegacyV2RuntimeActivati​​onPolicy参数(基本上是之前的受影响组件中的一个被加载?)。

Is it possible to set the app.config useLegacyV2RuntimeActivationPolicy parameter during runtime (basically before one of the 'affected' assemblies is being loaded?).

推荐答案

这可以通过CLR托管API的实现。我这里详细的技术。

This can be done via the CLR Hosting APIs. I detail the technique here.