的app.config< supportedRuntime>

编程入门 行业动态 更新时间:2024-10-25 06:20:45
本文介绍了的app.config< supportedRuntime>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

假设我有一个WinForms应用程序,是建立和编译的.NET 2.0使用VS2008。

Suppose I have a WinForms app that is built and compiled against .NET 2.0 using VS2008.

这是我的理解是在运行时,应用程序会首先尝试加载.NET 2.0 CLR,(因为这是它被编译的), 无论的对任何可能列在app.config文件中的任何supportedRuntime元素。

It is my understanding that at runtime, the app will attempt to load the .NET 2.0 CLR first, (because that is what it was compiled against), regardless of anything that may be listed in any "supportedRuntime" element of the app.config file.

如果它不能找到它,那么它将会进入通过检查的app.config等决定另一个版本的过程。

If it can't find it, then it will then go through a process of deciding on another version by checking the app.config, etc.

例如,如果.NET 2/3 / 3.5和.NET 4.0都安装一台机器上,我有:

For example, if .NET 2/3/3.5 and .NET 4.0 are installed on a machine, and I have:

<supportedRuntime>V4.0</supportedRuntime>

在App.config,应用程序仍然会选择加载和运行.NET 2.0。

in the app.config, the app will still choose to load and run .NET 2.0.

这是否正确?

感谢。

推荐答案

在MSDN页似乎是清楚的是用于构建一个只有后备情况:

The MSDN page seems to be clear that the one used to build is only the fallback case:

msdn.microsoft/en-us/library/w4atty68.aspx

如果在&lt; supportedRuntime&GT;元素不是present应用程序配置文件中,用于构建应用程序的运行的版本使用。

If the <supportedRuntime> element is not present in the application configuration file, the version of the runtime used to build the application is used.

您看到的行为不符合这个MSDN页面吗?

Are you seeing behavior that doesn't match that of this MSDN page?

更多推荐

的app.config&LT; supportedRuntime&GT;

本文发布于:2023-11-13 10:46:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584162.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:config   app   LT   GT   supportedRuntime

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!