如何从.NET生成独立的控制台应用程序

How to generate a standalone console application from .NET

本文关键字:独立 控制台 应用程序 NET      更新时间:2023-10-16

编辑:

我在MSVS2012 express上写了一个小的cpp程序(控制台应用程序)。该程序的负责人是:

#include <string>
#include <vector>
#include <algorithm>  
using namespace System;
using namespace System::IO;
using namespace std;

我需要在无法安装的计算机上部署可执行文件任何东西(我只是想把它用作一个简单的console.exe)。所以我需要这个应用程序完全独立。这可能吗?

如果你所说的.Net是指Visual Studio,如果你从C/C++ | Code Generation | Runtime Library选项(/MT或/MTd)中选择了非dll(即静态)运行库,那么你可能会逃脱惩罚。如果你使用dll版本,这些版本需要在你部署应用程序的机器上。