gpt4 book ai didi

c# - Visual Studio 速成版 - 特定于 Windows

转载 作者:行者123 更新时间:2023-11-30 23:23:39 25 4
gpt4 key购买 nike

我是 .NET 和 C# 的初学者,我是从“Pro C# 6.0 and .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 中的单声道框架上运行(假设我没有使用任何不受单声道支持的框架,如 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 速成版 - 特定于 Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38263028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com