.NET 3.5运行时和.NET 4运行时的兼容性 [英] .NET 3.5 runtime and .NET 4 runtime compatibility

查看:183
本文介绍了.NET 3.5运行时和.NET 4运行时的兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以运行基于.NET 3.5用的应用程序插件,建有.NET 4?

Is it possible to run an application built on .NET 3.5 with a plug-in built with .NET 4?

推荐答案

您需要将<打击>重建(不完全正确,检查更新)的.NET 3.5应用程序的目标。NET 4.0,因为默认情况下,它将开始在.NET 2.0运行时则其将不支持插件。

You will need to rebuild (not exactly true, check update) the .NET 3.5 application to target .NET 4.0 because by default it will start in the .NET 2.0 runtime which will then not support the plugin.

如果该机器只有.NET 4.0框架安装的应用程序将无法运行<打击>,除非重建的目标是明确

If the machine only has .NET 4.0 framework installed the application will not run unless rebuilt to target it specifically.

更新:

好了,你不需要毕竟要重建。克里斯的评论让我思考,我只是测试了专为.NET 3.5的控制台应用程序。您可以在其应用程序配置文件只需指定以下块:

Well, you don't need to rebuilt after all. Chris comment got me thinking and I just tested with a console application built for .NET 3.5. You can just specify in its application configuration file the following block:

<startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

如果这是present配置中的应用程序将使用.NET 4.0运行时。

If this is present in the configuration the application will use the .NET 4.0 runtime.

这篇关于.NET 3.5运行时和.NET 4运行时的兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆