Can my .Net app reference two different versions of a .net framework library?

﹥>﹥吖頭↗ 提交于 2019-12-04 04:39:26

Have a look at this : In-Process Side-by-Side It might be of some help.

If you have control over P3, yes. Go to the references section of the project, find the System.Data reference, and view it's properties window (right-click -> Properties).

Select "True" for the "Specific Version" property. Recompile, redeploy, etc.

Note that this will cause all sorts of runtime failures if .NET 2, 3, or 3.5 are not installed on the machine when the assembly attempts to load.

Edit

I've tried this, but with no luck. P3 still runs v4.0. Do you know if this setting would have any visible effect in the assembly generated for P3? E.g. The manifest says ".ver 2:0:0:0" whether "Specific Version" is set to true or not.

Try adding this to your app.config:

<configuration>
  <startup>
    <supportedRuntime version="v2.0.50727" />
    <supportedRuntime version="v4.0" />
  </startup>
</configuration>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!