在未安装 .Net 的 xp 上运行 .Net Framework 应用程序



我有一个用.Net Framework 4.0编写的应用程序,我需要能够在没有安装.Net的情况下在Win xp sp3上运行。

我发现使用 mono 和 mkbundle --static --deps,我可以实现我需要的东西(如果我理解正确的话(。所以我从一个简单的"Hello world"应用程序开始:

using System;
namespace Hello
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello world");
Console.ReadKey();
}
}
}

但是当我使用:

mkbundle --static --deps Hello.exe -o Hello -L /usr/lib/mono/4.0-api

发生错误。

编辑:感谢gethomast,我已经成功地为linux构建了应用程序。我不得不使用:

mkbundle --fetch-target mono-6.0.0-ubuntu-18.04-x64
mkbundle --static --deps Hello.exe -o Hello --cross mono-6.0.0-ubuntu-18.04-x64 --i18n none

但我需要在Windows xp上运行我的应用程序。 是否有下载Windows xp的工具/运行时的选项? 或者也许我需要使用 xp 上安装的单声道来构建应用程序? 或者也许我可以在安装了较旧的单声道和 VS 的情况下使用 win 10?

有人在这方面有一些经验吗?任何帮助表示赞赏。

mono GitHub 上的已知问题,请参阅 https://github.com/mono/mono/issues/16829

最新更新