想知道是否有人知道如何查看需要安装 .NET 框架的哪些部分才能使某些功能在旧机器上运行。有没有一种方法可以在不安装整个 .NET 框架的情况下将它们与我的应用程序一起安装?
5 回答
You could use Mono, the open source implementation of the .NET framework. The Mono installer is smaller than the .NET installer. Also, Mono works with Windows versions older than XP.
With Mono you can use the Linker to bundle only a small subset of the .NET framework, the one you need, with your application.
The downside is that Mono doesn't implement the entire .NET framework, at the moment is only compatible with the version 2.0 and parts of the 3.0. Anyway, there is a tool called MoMa which tell you how compatible with Mono is your application.
这些旧机器有多旧?看起来 .NET 2.0 可以安装在 Win98 机器上,请参阅http://msdn.microsoft.com/en-us/library/aa480241.aspx上的系统要求。
如果有足够的时间和/或金钱,您可以从 C# 生成本机代码。我从来不需要深入研究这些,但是Xenocode和Salamander都可以生成本机代码,和/或将框架程序集静态链接到您的代码,以便在没有安装 FX 的情况下运行。
不过,我认为我不会轻率地承担这一点……任何不能至少运行 Windows 98 的机器都不是我想要为其编写托管代码的东西。
Well, VMWare ThinApp (previously called Thinstall) may help you - but I've not used it myself, and I'd be somewhat wary of running .NET apps on anything other than a real .NET installation.
If you're only using part of the framework, you might be interested in the .NET 3.5 client profile which is at least somewhat smaller than the full framework - but of course, it may not contain everything you need...
据我所知,这是不可能的,您必须完全安装 .NET 框架运行时才能使其工作。无论如何,在我看来,试图把它拼凑起来根本不是一个好主意。