如何将 wpf 应用程序转换为 exe
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/804011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how can i convert a wpf application to exe
提问by
How can I convert a wpf application to a .exe which will run on all Microsoft Windows operating systems.
如何将 wpf 应用程序转换为可在所有 Microsoft Windows 操作系统上运行的 .exe。
回答by Jobi Joy
:) Compile in VS2008 and remember to check out the Bin{Debug|Release} folder of the project location to see the exe
:) 在VS2008中编译记得查看项目所在的Bin{Debug|Release}文件夹才能看到exe
回答by tofi9
WPF is by default an .exe, but will need .NET 3+. You can't create a WPF .exe and expect it to work on all Windows version, regardless whether the platform you've compiled your application for is installed.
WPF 默认是 .exe,但需要 .NET 3+。您无法创建 WPF .exe 并期望它适用于所有 Windows 版本,无论您编译应用程序的平台是否已安装。
It's like a library dependency in C/C++. Certain libraries don't work on older versions of Windows.
这就像 C/C++ 中的库依赖项。某些库在旧版本的 Windows 上不起作用。
回答by Eclipse
If you're in visual studio, hit F7.
如果您在 Visual Studio 中,请按 F7。
The application will be compiled into an exe file that can then be executed. It will usually be located underneath your solution directory:
该应用程序将被编译成一个可执行文件。它通常位于您的解决方案目录下:
SolutionDir\Bin\(Debug|Release)\Solution.exe
This file will only be able to run on Windows computers that have the necessary version of the CLR installed. As far as I know there's no way around that requirement.
此文件只能在安装了必要版本的 CLR 的 Windows 计算机上运行。据我所知,没有办法绕过这个要求。
回答by Reed Copsey
Build it in Visual Studio. It should run on any Windows system that has the correct framework installed. (Potentially .NET 3.5sp1, depending on what you included.)
在 Visual Studio 中构建它。它应该在任何安装了正确框架的 Windows 系统上运行。(可能是 .NET 3.5sp1,具体取决于您包含的内容。)