我是 .NET 和 C# 的初学者,我从《Pro C# 6.0 和 .NET 4.6 Framework》一书开始。
书中引用:
Each of the Express tools is limited in that it allows you to build .NET software that will run only on the Windows OS (7, 8.x, or 10). However, as mentioned in Chapter 1, the .NET platform runs on a wide variety of operating systems and hardware devices. Thus, if you need to build a .NET program that can run on (for example) Android or an Apple product, the Express products won’t offer much help.
我很难理解这意味着什么。据我了解,.NET 程序集(托管代码)将是平台无关的。那么为什么 IDE 的 Express 版本生成的代码应该仅特定于 Windows?生成的 CIL 不应该同样适合在 Linux 或 Mac OS X 中的 Mono 框架上运行(假设我没有使用 Mono 不支持的任何框架,如 WPF 等)?有人可以澄清这意味着什么吗?提前致谢。
最佳答案
此版本的 Visual Studio(以及社区版):
includes Windows SDK's compilers and core files, which developers can use to build Win32 applications
如果您构建一个 C# web 应用程序,那么该应用程序仍然可以被其他平台用户访问,前提是该应用程序托管在 Windows 服务器(或 Mac/Linux 上)服务器使用 Mono 而不是 .Net)。
With web applications you only need to ensure your html/jscript etc. is compatible with the users browser, although the server OS and web server matter in terms of hosting the web app.
在这种情况下,客户端不会运行您的 C# .NET 应用程序,您(Windows 服务器)运行。
但是,如果您正在为操作系统构建普通 C# .NET 应用程序(不是 Web 应用程序),那么您只能针对 Windows 进行开发,因为您没有用于其他任何内容的编译器.
关于平台独立性的旁注:您可以在 this Stack Overflow Question 上看到一场有趣的辩论。关于它。这个问题已有 5 年历史,但答案是新的(2016 年)。
关于c# - Visual Studio Express 版本 - Windows 特定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38263028/