简体   繁体   中英

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? 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. My client uses a Windows C# app on the frontend, and Linux/PHP on the backend. 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.

See "Version Compatibility" section here: http://msdn.microsoft.com/en-us/library/8477k21c.aspx

What you can do is have your .NET 2 code access the .NET 4 libraries via a web service. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM