问题描述
我在带有 .NET 的 Visual Studio 中使用过 C#,并且在 openSUSE Linux 上使用过 Mono,但我并不真正了解它是如何工作的.
I have used C# in Visual Studio with .NET, and I have played around a little with Mono on openSUSE Linux, but I don't really understand how it works.
如果我在 .NET 上的 Windows 中编写应用程序,这与 Mono 有何关系?我不能在没有 Wine 的情况下在 Linux 上执行一个 Windows .exe 文件,所以它不能帮助我执行在 Windows 中开发的应用程序.
If I write an app in Windows on .NET, how does this relate to Mono? I can't just execute an a Windows .exe file on Linux without Wine, so it doesn't help me execute apps developed in Windows.
目的纯粹是为了在 Linux(和其他)上拥有一个等效的 .NET 库来简化跨平台开发吗?例如,如果我是一家企业,想接触 Linux 客户,但真的想使用 .NET,那么 Mono 应该是我的选择吗?还是我还缺少什么?
Is the purpose purely to have a .NET library equivalent on Linux (and others) to make cross platform development easier? For example, if I was a business and wanted to reach Linux customers, but really wanted to use .NET, then Mono should be my choice? Or is there something more that I'm missing?
推荐答案
一个 Windows EXE 包含多个部分".简化,.net 代码 (=MSIL) 只是 EXE 的一部分,在 EXE 中还有一个真正的"本机 Windows 部件,用作 .net 的某种启动器然后执行 MSIL 的框架.
A Windows EXE contains multiple "parts". Simplified, the .net Code (=MSIL) is only a Part of the EXE, and there is also a "real" native Windows Part inside the EXE that serves as some sort of launcher for the .net Framework which then executes the MSIL.
Mono 只会获取 MSIL 并执行它,而忽略本机 Windows 启动器的内容.
Mono will just take the MSIL and execute it, ignoring the native Windows Launcher stuff.
再次,这是一个简化的概述.
Again, this is a simplified overview.
我担心我对深层细节的理解不足以提供很多细节(我大致知道 PE Header 是什么,但不是真正的细节),但我发现了这些有用的链接:
I fear my understanding of the deep deep details is not good enough for really much detail (I know roughly what a PE Header is, but not really the details), but i found these links helpful:
NET 程序集结构 - 第二部分
.NET 基础 -.NET 程序集结构
这篇关于单声道如何工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!