In order to use a CLR 2.0 mixed mode assembly, you need to modify your App.Config file to include:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
The key is the useLegacyV2RuntimeActivationPolicy flag.
This causes the CLR to use the latest version (4.0) to load your mixed mode assembly. Without this, it will not work.
Note that this only matters for mixed mode (C++/CLI) assemblies. You can load all managed CLR 2 assemblies without specifying this in app.config.
为了使用CLR2.0的混合模式组件,需要在App.Config文件中加入特定配置来激活遗留策略,确保组件能通过.NET Framework 4.0加载。此配置仅适用于混合模式组件。
467

被折叠的 条评论
为什么被折叠?



