安装窗口应用程序而不安装.net框架 [英] Install window application without installing .net framework

查看:94
本文介绍了安装窗口应用程序而不安装.net框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2010中开发了一个小窗口应用程序,我为它创建了一个安装文件。有没有办法安装我的应用程序而无需安装计算机的.Net Framework。



谢谢

解决方案

C#与.NET框架紧密绑定,并且胜利;没有它工作 - 甚至基本数据类型如 string 都是.NET的一部分而不是语言的一部分。所以不,不是真的就是答案 - 为了运行你的应用程序,需要一个版本的框架。

现在,你可以做的事情,但最简单的是设置目标框架版本已经安装在目标操作系统上: https://en.wikipedia.org/wiki/.NET_Framework_version_history [ ^ ]显示哪个操作系统附带哪个.NET版本作为标准。



如果操作系统包含它,您的应用程序应在没有额外框架安装的情况下运行。


这是相对较新的,但你应该检查一下:

编译应用程序.NET Native [ ^ ]

不,C#中那些旧版本的应用程序使用.NET作为其支持框架,因此无法将它们编译为本机代码(如解决方案2中所示)。



Windows Runtime,但是不需要你安装特定的框架(除了它自己),因为他们已经在Windows中移植了.NET框架的组件运行时本身。但是从Windows 8开始,这些事情就会出现。它们使用与C ++或Visual C ++相同的概念来编译为本机金属代码。 C#代码不编译为本机代码,而是编译为字节码,使用 JIT编译器,编译为.NET框架虚拟机的本机代码。 这就是为什么,你不能在不安装.NET框架的情况下运行代码。



在很多方面,它与Win32有关,但是从那以后我对Win32没有高级经验我不会谈这么多。


I've developed a small window application in Visual Studio 2010 and I've created a setup file for it. Is there any way where I can install my application with out installing .Net Framework of a computer.

Thanks

解决方案

C# is tightly bound to the .NET framework, and won;t work without it - even "basic" datatypes like string are part of .NET rather than a part of the language. So "no, not really" is the answer here - a version of teh framework is necessary in order to run your app.
Now, there are things you can do but the simplest is to set the target framework version to one that is installed on your target OS already: https://en.wikipedia.org/wiki/.NET_Framework_version_history[^] shows which OS comes with which .NET version as standard.

If the OS includes it, your app should run without additional framework installation.


It is relatively new, but you should check it:
Compiling Apps with .NET Native[^]


No, those old versions of applications in C# used .NET as their supportive framework so they cannot be compiled to native code (as in Solution 2).

Windows Runtime, however doesn't need you to have a specific framework (other than itself) installed, because they have already ported the components of .NET framework in Windows Runtime itself. But these things come over since Windows 8 and onwards. They use the same "concept" that C++ or Visual C++ had, to compile down to native metal code. C# code doesn't compile down to native code, instead it is compiled down to bytecode, which using JIT compiler, is compiled to native code for .NET framework's virtual machine. That is why, you cannot run the code without installing .NET framework.

In many ways, it is related to Win32, but since I have no "advanced" experience with Win32 I won't talk about that much.


这篇关于安装窗口应用程序而不安装.net框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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