如何将 Visual Studio Windows Forms 项目转为应用程序?
我编写了一个工时表应用程序,现在我想发布它,以便人们可以安装和运行它。
我已经尝试过 Visual Studio 2008 的发布功能,但这给了我一个非常令人困惑的 clickOnce 应用程序/安装程序,但是当我运行它时它可以工作,但是当我将安装程序导出到另一台电脑时,它会在安装结束时崩溃安装。
所以我尝试只复制已安装的文件,但程序在启动时崩溃了。
是否有一种简单的方法将应用程序编译为简单的独立可执行文件或可能包含包含资源(图像/类)的单独文件夹?
I programmed an hour-sheet application and now I would like to publish it so people can install and run it.
I've tried the publish function of visual studio 2008 but this gives me a clickOnce application/installer that's really confusing, but it works when I run it, but when I export the installer to another pc it installs it crashes at the end of the install.
so I tried just coping the installed files but then the program crashes at startup.
Is there a simple way to compile the application to a simple standalone executable or maybe containing a separate folder containing the resources (images/classes)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以从
bin\Release
复制可执行文件,它应该可以工作。如果它使用任何不属于 .Net 框架本身的 DLL,您还需要复制它们。 (在每个引用的属性中将“复制本地”设置为 true)
如果它使用任何其他文件,您需要将它们复制到正确的位置或将它们嵌入到 EXE 或 DLL 中。
You can copy the executable from
bin\Release
and it should work.If it uses any DLLs that are not part of the .Net framework itself, you'll also need to copy those. (Set Copy Local to true in the properties for each reference)
If it uses any other files, you'll need to copy them to the right place or embed them in the EXE or a DLL.
我会将安装项目添加到您的解决方案中,这将创建一个 setup.exe。
以下是一些链接:
http://www.dreamincode.net/forums/index.php?showtopic= 58021
http://msdn.microsoft.com/en-us/library/ms235317。 aspx
这将确保在安装软件时将 dll 和程序集部署到适当的位置。它还将确保在您卸载它时删除文件。
I would add Setup Project to your solution which will create a setup.exe.
Here's some of the links:
http://www.dreamincode.net/forums/index.php?showtopic=58021
http://msdn.microsoft.com/en-us/library/ms235317.aspx
This will make sure that the dlls and assemblies are deployed to appropriate place when you install your software. It will also make sure that it gets rids of files when you uninstall it.
你可以在这里找到你的.exe Projectpath\bin\Debug 你也必须提供.config 文件
you can find your .exe here Projectpath\bin\Debug you have to give .config file too