【问题标题】:Running .Net Framework application on xp without .Net installed在未安装 .Net 的 xp 上运行 .Net Framework 应用程序
【发布时间】:2019-09-22 13:35:19
【问题描述】:

我有一个用 .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?

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

【问题讨论】:

    标签: c# .net mono static-linking mkbundle


    【解决方案1】:

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

    【讨论】:

    • 谢谢,现在它可以在 linux 上运行。不幸的是,我需要在 Windows 上运行它。如果我使用 --list-targets 我看不到任何 Windows 平台可供选择。如何为 Windows 构建它?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-04
    相关资源
    最近更新 更多