通过包含DLLS在没有.NET的计算机上运行.NET应用程序??? [英] Run a .NET app on a machine without .NET by including DLLS????

查看:96
本文介绍了通过包含DLLS在没有.NET的计算机上运行.NET应用程序???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个程序,该程序将分发到USB记忆棒(拇指驱动器,闪存驱动器,近来称为它们).这是至关重要的应用程序,必须在将驱动器放入计算机后2分钟内启动并运行.不幸的是,直到迟到我才收到2分钟的要求(是的,我知道....但是让我们来谈谈编程,而不是项目管理;-)).

我今天安排了在虚拟机中安装.NET 2.0的时间,安装大约需要8-10分钟.我的客户不会去的.所以我想知道是否可以将程序中引用的所有DLL复制到输出位置并随应用程序一起分发?如果没有,是否可以通过某种方式构建.NET安装程序,使其仅安装我实际使用的内容?

我正在观看.NET的安装,其中有很多东西我只是不在程序中使用.您可以提供的任何提示将不胜感激.

I am working on a program that will be distributed on a USB stick (thumbdrive, flashdrive, whatever they''re called these days). It''s a critical application and must be up and running within 2 minutes of putting the drive in the machine. Unfortunately, the 2 minute requirement didn''t get to me until late (yeah, I know.... but let''s talk about the programming, not the project management ;-) ).

I timed the installation of .NET 2.0 in a virtual machine today and it took about 8-10 minutes for it to install. My client''s not gonna go for that. So I''m wondering if I can just copy all the DLLs that are referenced in my program to the ouput location and distribute those with the application? If not, is there some way I can build a .NET installer that installs only the stuff I''ve actually used?

I was watching the .NET installation and there''s a lot of stuff in there that I just don''t use in my program. Any hints you can give would be greatly appreciated.

推荐答案

我不认为可以做到.即使您复制了所有注册表设置和文件并设法在短时间内将其全部注册到新计算机中,您仍然冒着无法正常工作的风险,并且保持此自定义安装程序"更新的成本变大.

获得该结果的最佳方法是不使用.NET(或任何类似的框架),因此您可以构建一个独立的可执行文件,并使其在几秒钟内启动并运行.但是,由于我猜您的应用程序已经开发,并且从头开始重建它太昂贵了,因此其他选择可能是使用虚拟机.您可以使用操作系统,.NET和已安装并配置您的应用程序来设置虚拟机.

但是仍然需要安装vmware-除非您要求在安装应用程序之前将其安装在所有计算机上.但是在这种情况下,您只需要在使用您的应用程序之前先安装.NET,就不会有太大的问题.我认为这是在不删除.NET的情况下解决问题的最佳方法.祝你好运. :)
I don''t think it can be done. Even if you copy all the registry settings and files and manage to register it all in a new machine in a small time, you still risk having something which won''t work properly, and the cost of keeping this "custom installer" updated would be big.

The best way to get that result is not using .NET (or any similar framework), so you can build a standalone executable and have it up and running in seconds. However, since I guess your app is already developed and it would be too expensive to re-build it from scratch, the other options might be using a virtual machine. You can set up a virtual machine with the operating system, .NET and your app installed and configured.

But still you would have to install vmware - unless you demand it to be installed on all machines before you setup your app. But in this case, you can simply demand that .NET is installed prior to using your app, it shouldn''t be too much of a problem. I think this is the best way to solve your problem without dropping .NET. Good luck. :)


您可能想研究一个选项,将所需的框架元素编译到应用程序中.尽管这些通常相当昂贵,但它们可能正是您想要的.看看类似安装 [ ^ ].
You might want to look into an option where the framework elements you need are compiled into your application. These are generally fairly expensive though, but they might be just what you want. Take a look at things like Thinstall[^] or Xenocode[^].


嗯,我喜欢其他人发布的内容,但这是您可能要考虑的其他一些选择:

Hmm, I like what others have posted, but here are some other options you may want to consider:

  1. Mono是.Net的开源和跨平台实现.不过请注意,它没有.Net具备的所有功能,例如WPF.它也有很多错误(或者我上次看过它).我认为您可以使用.Net编译您的项目,然后在安装了Mono的计算机上使用它.您可以查看Mono的安装时间,以查看它们是否比Microsoft .Net Framework的安装时间更好.
  2. 有一个称为".Net Compact Framework"的东西.它是较大的.Net Framework的子集,因此较小.(即,安装时间较短).如果仅需要.Net Compact Framework提供的功能,则可以改用它.虽然不确定如何使客户端计算机安装它.也许您可以将所有项目(在Visual Studio项目设置中)设置为使用.Net CF?我不确定细节,但这至少是您可以考虑的一种选择.


这篇关于通过包含DLLS在没有.NET的计算机上运行.NET应用程序???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆