可以c#编译的应用程序运行在没有安装.net的机器上? [英] Can c# compiled app run on machine where .net is not installed?

查看:219
本文介绍了可以c#编译的应用程序运行在没有安装.net的机器上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Windows开发一个小实用程序,我更喜欢这样做在c#,因为它更容易(我是一个java开发人员)。

I want to develop a small utility for windows and I prefer doing that in c# because it is easier (I'm a java developer).

该实用程序将可供许多人下载,我假设其中一些不会安装.net框架(这是假设正确,说我目标win xp以上?)

The utility will be available for download by many people and I assume some of them will not have the .net framework installed (is this assumption correct, say I target win xp and above?)

我的问题是:can ac#应用程序的编译方式不需要安装.net框架?

My question is: can a c# application be compiled in a way that it will not require the .net framework installed?

推荐答案

通常,您需要在目标系统上安装.NET Framework。没有简单的方法。

Normally, you will need the .NET Framework being installed on the target system. There is no simple way around that.

但是,某些第三方工具(如Xenocode或Salamander)允许您创建独立应用程序。查看此相关问题:

However, certain third-party tools such as Xenocode or Salamander allow you to create stand-alone applications. See this related question:


由于这些解决方案不直接,需要商业产品,我建议您创建一个简单的Visual Studio 设置和部署项目。在项目的属性中,您应该包括.NET Framework作为先决条件。然后,在安装应用程序之前,创建的setup.exe会自动下载并安装.NET Framework。

As these solutions are not straight-forward and require commercial products I would recommend you to create a simple Visual Studio Setup and Deployment project. In the properties of the project you should include the .NET Framework as a pre-requisite. The setup.exe created will then automatically download and install the .NET Framework prior to installing your application.

这篇关于可以c#编译的应用程序运行在没有安装.net的机器上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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