在 Visual Studio 2010 中编译为 C# 应用程序的独立 exe

在 Visual Studio 2010 中编译为 C# 应用程序的独立 exe

问题描述:

类似于这个问题编译为独立的可执行文件 (.exe)视觉工作室

但没有什么对我有用.

我用 C# 编写了一个非常简单的应用程序.我希望将其编译为独立的 exe 文件,但我似乎找不到合适的设置来执行此操作.一切都编译到一个发布文件夹中,只有安装/安装文件.

I've written an app that is very simple in C#. I want this to compile to a stand alone exe file, but I can't seem to find the proper settings to do this. Everything compiles into a publish folder and there is only the setup/install files.

谢谢!

您只需编译它.在 binRelease(或 binDebug)文件夹中,.exe 将在那里.

You just compile it. In the binRelease (or binDebug) folder, the .exe will be in there.

如果您要问如何制作一个完全不依赖于 .NET 框架的可执行文件,那要困难得多,您需要购买诸如 RemoteSoft 的蝾螈.一般来说,这并不值得费心:Windows Vista 已经预装了 .NET Framework 2.0,所以如果您对此感到担心,您可以只针对 2.0 框架(然后只有 XP 用户必须安装该框架).

If you're asking how to make an executable which does not rely on the .NET framework at all, then that's a lot harder and you'll need to purchase something like RemoteSoft's Salamader. In general, it's not really worth the bother: Windows Vista comes with .NET framework 2.0 pre-installed already so if you're worried about that, you can just target the 2.0 framework (then only XP users would have to install the framework).