简体   繁体   English

我可以在.NET 2.0上使用.NET 4.0 API调用吗?

[英]Can I use .NET 4.0 API calls on .NET 2.0?

If I make .NET 4.0 API calls and the customer only has .NET 2.0 installed, will my EXE work? 如果我进行.NET 4.0 API调用,而客户仅安装了.NET 2.0,我的EXE是否可以工作? I assume no -- absolutely not. 我认为不会-绝对不会。 But I want to reconfirm and point this out to my client yes/no. 但我想再次确认并向我的客户指出是/否。

Background... I'm from the Linux/PHP world. 背景...我来自Linux / PHP世界。 My client uses a Windows C# app on the frontend, and Linux/PHP on the backend. 我的客户端在前端使用Windows C#应用程序,在后端使用Linux / PHP。 He's asked me to investigate this issue. 他要我调查这个问题。

尝试运行使用.NET 4.0编写和编译的任何内容时,.NET 2.0运行时都会出错,但事实并非如此。

Application code targeted against the .NET 4.0 framework will not run in an environment that only has the .NET 2.0 framework installed. 针对.NET 4.0框架的应用程序代码将无法在仅安装.NET 2.0框架的环境中运行。

See "Version Compatibility" section here: http://msdn.microsoft.com/en-us/library/8477k21c.aspx 请参阅此处的“版本兼容性”部分: http : //msdn.microsoft.com/zh-cn/library/8477k21c.aspx

What you can do is have your .NET 2 code access the .NET 4 libraries via a web service. 您可以做的是让.NET 2代码通过Web服务访问.NET 4库。 If you were to expose the .NET 4 API via a web service, it would be agnostic of the .NET version and the technology between them all together. 如果要通过Web服务公开.NET 4 API,则将无法确定.NET版本以及它们之间的技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 默认情况下,.NET 2.0 API调用在.NET 4.0运行时上是否起作用,还是需要额外的安装步骤? - Do .NET 2.0 API Calls Work on .NET 4.0 Runtime by Default, or Do They Require Extra Setup Steps? 在.Net 2.0中使用.Net 4.0 UserControl - Use .Net 4.0 UserControl in .Net 2.0 如果我知道.NET 4.0安装在用户的机器上,我可以假设.NET 2.0也是如此吗? - If I know .NET 4.0 is installed on a user's machine, can I assume .NET 2.0 is as well? 在.net 4.0 wpf应用程序中使用.net 2.0 dll - use .Net 2.0 dll in .net 4.0 wpf application 我可以托管带有.NET 4.0应用程序池的.NET 2.0运行Web应用程序吗 - Can I Host .NET 2.0 Running Web Application with .NET 4.0 App Pool WCF服务(.NET 4.0)可以具有.NET 2.0客户端吗? - WCF service (.NET 4.0) can have a .NET 2.0 client? 在.net 2.0上构建的exe可以引用在.net 4.0上构建的dll吗? - Can an exe built on .net 2.0 refer to a dll built on .Net 4.0 我可以使用在.NET Standard 2.0中为.NET Framework编写的包吗? - Can I use packages written for .NET Framework in .NET Standard 2.0? 如何在.net 2.0项目中使用.net 3.0类? - How can I use .net 3.0 class in .net 2.0 project? 我可以使用内容协商将视图返回到ASP.NET核心中的浏览器和JSON到API调用吗? - Can I use Content Negotiation to return a View to browers and JSON to API calls in ASP.NET Core?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM