在没有 .NET Framework 的情况下运行基于 .net 的应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/953146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Running .net based application without .NET Framework
提问by crauscher
Is there a way to run .net based applications without .net framework installed. Is there a way to do this. Is there a software that can achive this. Commercial software is also possible.
有没有办法在没有安装 .net 框架的情况下运行基于 .net 的应用程序。有没有办法做到这一点。有没有软件可以做到这一点。商业软件也是可能的。
Added:
添加:
Has anyone any experience with VMWare thin client?
有没有人有使用VMWare 瘦客户端的经验?
采纳答案by Dana Holt
There are a several different tools out there, a couple I have tried are:
有几种不同的工具,我尝试过的几种工具是:
You can find more by doing a search for ".NET Linker."
您可以通过搜索“ .NET Linker”找到更多信息。
The two above, which I tried, seemed to work ok, but I never widely tested my code built with them. I tried them mostly out of curiosity.
我尝试过的上述两个似乎工作正常,但我从未广泛测试过我用它们构建的代码。我主要是出于好奇而尝试它们。
My .NET apps are mostly used by IT departments. Installing the .NET framework is no big deal for them.
我的 .NET 应用程序主要由 IT 部门使用。安装 .NET 框架对他们来说没什么大不了的。
If you want to write software more targeted at end users then the .NET install may turn them off.
如果您想编写更针对最终用户的软件,那么 .NET 安装可能会关闭它们。
回答by Joel Coehoorn
You can use mono to static-link all the framework dlls you need.
您可以使用 mono 静态链接您需要的所有框架 dll。
Of course, that limits you to the mono implementation of the framework, which is getting better but is still incomplete in a few places.
当然,这将您限制在框架的单声道实现上,它正在变得更好,但在一些地方仍然不完整。
Update:
Based on your various comments, my best suggestion is to use version 2.0 of the framework. That will install just fine on windows 2000 with no trouble, and you can target it from Visual Studio 2008 if you need to.
更新:
根据您的各种意见,我最好的建议是使用该框架的 2.0 版。这将在 Windows 2000 上安装得很好,没有问题,如果需要,您可以从 Visual Studio 2008 定位它。
I'm also a little curious as to your windows 2000 requirement. Are you deploying to business or home environments?
我也有点好奇你的 Windows 2000 要求。您要部署到企业环境还是家庭环境?
Almost no home users have windows 2000. Home users ended up with (shudder)Windows ME instead, which was released about the same time, and for that reason have almost completely moved on to Windows XP. You're more likely to see as windows 98 machine in a home than windows 2000, and not even Microsoft still supports windows 98.
几乎没有家庭用户拥有 Windows 2000。家庭用户最终使用(不寒而栗)Windows ME,它大约在同一时间发布,因此几乎完全转向了 Windows XP。与 Windows 2000 相比,您更有可能在家庭中看到 Windows 98 机器,甚至 Microsoft 也不支持 Windows 98。
On the other hand, an awful lot of businesses still use windows 2000 machines in large numbers. But business environments don't usually have a problem installing the .Net framework. They can even add it to machines automatically via group policy deployment if they have to.
另一方面,大量企业仍然大量使用 Windows 2000 机器。但是商业环境安装 .Net 框架通常不会出现问题。如果需要,他们甚至可以通过组策略部署将其自动添加到机器中。
回答by Aiden Bell
Use Mono, it is developed by Novell and is open-source
使用 Mono,它由 Novell 开发并且是开源的
Edit: Question was about running without an installed runtime regardless of "supplier". Even so, here is a link to Mono's wikipedia entry. Enjoy.
编辑:问题是关于在没有安装运行时的情况下运行,而不管“供应商”如何。即便如此,这里还是 Mono 维基百科条目的链接。享受。
回答by anelson
My team faced a similar problem. We needed to run our .NET 3.5 WPF app under Windows PE, which has no usable .NET framework. I evaluated all the options and found Xenocode PostBuild to be the best.
我的团队遇到了类似的问题。我们需要在没有可用的 .NET 框架的 Windows PE 下运行我们的 .NET 3.5 WPF 应用程序。我评估了所有选项,发现 Xenocode PostBuild 是最好的。
It's GUI is a bit counterintuitive and there were some bumps in the road getting it working, but it's been reliable since.
它的 GUI 有点违反直觉,而且在让它工作的道路上有一些颠簸,但从那以后它一直很可靠。
If you go that route, be advised you need to make sure your code is fully debugged before you generate the unmanaged executable, as you cannot debug the resulting app (unless you like assembler).
如果您走这条路,请注意您需要确保在生成非托管可执行文件之前完全调试代码,因为您无法调试生成的应用程序(除非您喜欢汇编程序)。
Also note that embedding the .NET framework makes for a big executable. ~20MB for 2.0, and ~40MB for 3.5.
另请注意,嵌入 .NET 框架可生成大型可执行文件。2.0~20MB,3.5~40MB。
回答by John Bellone
You did not mention the type of software that you were looking to run so I figured I would add my two cents.
你没有提到你想要运行的软件类型,所以我想我会加两分钱。
Microsoft has released Silverlight, a .NET based browser plugin, and they have been working with Novell to put out a version of Silverlight based upon the Mono compiler mentioned above called Moonlight. Microsoft natively supports Windows and Mac OS X 10.5.
Microsoft 已经发布了 Silverlight,一个基于 .NET 的浏览器插件,并且他们一直在与 Novell 合作推出基于上述 Mono 编译器的 Silverlight 版本,称为 Moonlight。Microsoft 本身支持 Windows 和 Mac OS X 10.5。
If you want more information here are some links: http://en.wikipedia.org/wiki/Microsoft_Silverlighthttp://www.microsoft.com/silverlight/
如果您想了解更多信息,这里有一些链接:http: //en.wikipedia.org/wiki/Microsoft_Silverlight http://www.microsoft.com/silverlight/
回答by Brendan Kowitz
This really sounds like more trouble than its worth when you are working with an OS that supports .net.
当您使用支持 .net 的操作系统时,这听起来确实比它的价值更麻烦。
.net 2.0 I think even comes down as a Windows Update these days, its only 26mb, and you only install it once. If you want something thats win32 native go back to unmanaged C++.
.net 2.0 我认为这些天甚至可以作为 Windows 更新,它只有 26mb,而且你只安装一次。如果您想要 win32 本机的东西,请返回非托管 C++。
Also check out: SmallestDotNet(although not windows 2000, it mentions that "Soon, Microsoft will release a super-small download for XP SP2 machines that have no version of the .NET Framework".)
另请查看:SmallestDotNet(虽然不是 Windows 2000,但它提到“很快,微软将为没有 .NET Framework 版本的 XP SP2 机器发布一个超小下载”。)
回答by Joop Muis
If one does not want to use the .NET framework, I think it would be better to consider using an other programming language, which generates a stand-alone executable. Something like Delphi or, if the prize is important, Lazarus. But I'm sure there are other alternatives.
如果不想使用 .NET 框架,我认为最好考虑使用其他编程语言,它会生成一个独立的可执行文件。像德尔福之类的东西,或者,如果奖品很重要,拉撒路。但我确信还有其他选择。
回答by Marwen Trabelsi
Old question but it can help other readers
老问题,但它可以帮助其他读者
You can use IKVM's binaries to run a Mono/.Net/Java application without any pre-installed framework. Just keep in your mind:
您可以使用 IKVM 的二进制文件来运行 Mono/.Net/Java 应用程序,而无需任何预装框架。请记住:
You should be able to execute it successfully. (On Windows .NET, remember to copy the IKVM dll's to the current directory.)
您应该能够成功执行它。(在 Windows .NET 上,记得将 IKVM dll 复制到当前目录。)
Please refer to the documentationto get a better view.
请参阅文档以获得更好的视图。
回答by Mark Brito
It's called statically linking the .net framework. Mono allows it and there are other vendors too. One case is if you need to run in windows pe.
它被称为静态链接 .net 框架。Mono 允许它,也有其他供应商。一种情况是,如果您需要在 windows pe 中运行。
回答by tekBlues
The only alternative to .NET framework I know is MONO (for LINUX).
我所知道的 .NET 框架的唯一替代方案是 MONO(对于 LINUX)。

