在 .net 4 计算机上运行使用 Visual Studio 2008 编译的应用程序

发布于 2024-09-27 07:06:02 字数 458 浏览 2 评论 0原文

我用 vs 2008 和 .net Framework 3.5 编译了一个应用程序。

我尝试在仅使用 .net Framework 4(未安装 .net Framework 3.5)的计算机上运行此应用程序,但出现错误(表示它无法加载程序集 ....ServiceModel... 版本3.0)。

安装 .net Framework 3.5 SP 1 后即可正常工作。

我发现一个文档说.net框架向后兼容: http://msdn .microsoft.com/en-us/library/ff602939.aspx

我错过了什么吗?我有办法在 vs 2008 中编译应用程序并能够在仅使用 .net Framework 4 的计算机上运行它吗?

谢谢。

I've compiled an application with vs 2008 and .net framework 3.5.

I tried to run this application on computer with only .net framework 4 (.net framework 3.5 is not installed) and I've got an error (says that it can't load the assembly ....ServiceModel.... version 3.0).

After installing .net framework 3.5 SP 1 it works.

I have found a documents says that .net framework is backward compatible: http://msdn.microsoft.com/en-us/library/ff602939.aspx

Am I missing something? I there a way to compile an application in vs 2008 and be able to run it on a computer with .net framework 4 only?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三寸金莲 2024-10-04 07:06:02

从这个 MSDN 页面。

.NET Framework 4 不会自动使用其版本的公共语言运行时来运行使用早期版本的 .NET Framework 构建的应用程序。若要使用 .NET Framework 4 运行旧版应用程序,必须使用 Visual Studio 中的项目属性中指定的目标 .NET Framework 版本来编译应用程序,或者可以使用应用程序配置文件中的 Element 指定支持的运行时。< /em>

因此,最好的办法可能是安装 3.5 框架,但否则请尝试更改 app.config 中的 supportedRuntime 元素。

From this MSDN page.

The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework. To run older applications with .NET Framework 4, you must compile your application with the target .NET Framework version specified in the properties for your project in Visual Studio, or you can specify the supported runtime with the Element in an application configuration file.

So the best thing would probably be to install the 3.5 framework, but otherwise try changing the supportedRuntime element in the app.config.

心在旅行 2024-10-04 07:06:02

.NET Framework 4 可以运行 .NET Framework 2 及更高版本的应用程序。 但是,您必须安装该框架的完整版本。一般的可再发行包仅附带“客户端配置文件”——框架中可用类和方法的子集。

The .NET Framework 4 can run .NET Framework 2 and up applications. However, you have to install the full version of the framework. The general redistributable packages only ship with the "client profile" -- a subset of the available classes and methods in the framework.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文