在机器上运行没有.net框架的c#.exe [英] Running the c# .exe without .net framework on machine

查看:103
本文介绍了在机器上运行没有.net框架的c#.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在机器上运行没有.net框架的ac#.exe。

如何运行c# .exe没有在PC上安装.net框架?



谢谢。

但是你可以解释一下如何安装.net框架我的应用安装好吗?我确切关注的是,当用户安装了应用程序时,没有任何额外的安装它可以很好地工作。

解决方案

你不能。



C#不会编译为本机代码:它编译为一种称为中间语言的东西,由公共语言运行时(CLR)执行。



没有.NET框架,程序不能也不会运行。



请注意,.NET框架无论如何都安装了Vista及以上版本......





包装是项目所需的组件并将其放入文件中吗?





参见这里 [ ^ ] - MSDN部署指南。


最实用的方法如果你绝对想要避免依赖.NET框架(也可能是出于性能考虑),那就是使用C ++。 Visual C ++ 2010可能是微软发布的C ++编译器的最佳版本之一。


Griff是对的,但我想加两美分:



更好的问题是:我可以在没有Windows的情况下运行C#应用程序吗?答案是是的,在许多情况下。



您确定了解.NET的作用吗?由于Window历史上是DOS上的框架和运行时主机,现在它逐渐发生在.NET上。我真的希望Windows会死,但.NET不会。即使是现在我也知道几个基于纯.NET的开发平台(更确切地说,ECMA / ISO CLR规范)。

.NET可以在许多操作系统上以标准兼容的Mono软件的形式提供( http://en.wikipedia.org/wiki/Mono_(software) [ ^ ])。我在Linux机器上运行我在Windows上编译的应用程序(甚至使用Forms)而无需重新编译。



实际上,最好不要担心安装.NET,它会成为一个常见的地方,并与新版本的Windows捆绑在一起。即使不是这样,全面的解决方案是使用应用程序的安装来部署.NET可重新分发,这不是很难做到。



从此开始: http://msdn.microsoft.com/en-us/library/6hbb4k3e.aspx [ ^ ],另见: http://www.netomatix.com/articles/KBArticle.aspx?a=324733 [<一个href =http://www.netomatix.com/articles/KBArticle.aspx?a=324733target =_ blanktitle =新窗口> ^ ]。



Google: http://en.lmgtfy.com/?q=(部署+ OR +部署+ OR +分发+ OR +发布)+ .net + framework + with + application [ ^ ]。



< DD> -SA

Hi,

I want to run a c# .exe without .net framework on a machine.
How can I run c# .exe without installing .net framework on the PC?

Thank you.
But may you explain how can I install .net framework with my application installation please? My exact concern is that when a user have installed the application , without any extra installation it work perfectly.

解决方案

You can't.

C# does not compile to native code: it compiles to something called Intermediate Language which is executed by the Common Language Runtime (CLR).

Without the .NET framework, the program cannot, and will not run.

Note though that the .NET framework is installed with Vista and above anyway...


"Is the packing the assemblies that the project wants and put it in it's files possible?"


See here[^] - MSDN guide to deployment.


The most practical approach to take if you absolutely want to avoid dependencies on the .NET framework (and maybe also due to performance considerations) is to use C++. Visual C++ 2010 is probably one of the best versions of the C++ compiler to ever be released by Microsoft.


Griff is right, but I want to add two cents:

The better question is: "can I run the C# application without Windows?" The answer is "Yes, in many cases".

Are you sure you understand the role of .NET? As Window was historically a framework and run-time host on top of DOS, now it gradually happens to .NET. I really hope that Windows will die, but .NET will not. Even now I know several developing platforms based on pure .NET (more exactly, ECMA/ISO CLR specifications).
.NET is available on many OS in the form of standard-compliant Mono software (http://en.wikipedia.org/wiki/Mono_(software)[^]). I run my applications compiled on Windows (even with Forms) on my Linux machine without recompilation.

Practically, it's good not to afraid about having .NET installation, it becomes a common place and is bundled with newer versions of Windows. Even if it is not, the comprehensive solution is to deploy .NET re-distributable with the installation of application, which is not so hard to do.

Start from this: http://msdn.microsoft.com/en-us/library/6hbb4k3e.aspx[^], see also: http://www.netomatix.com/articles/KBArticle.aspx?a=324733[^].

Google: http://en.lmgtfy.com/?q=(deploy+OR+deployment+OR+distribute+OR+distributing)+.net+framework+with+application[^].

—SA


这篇关于在机器上运行没有.net框架的c#.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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