EXE 生成在 obj\Debug 文件夹中

发布于 2024-09-09 10:32:34 字数 213 浏览 8 评论 0原文

我继承了一个 Windows 窗体应用程序,并且发现每次编译时都会在 obj\Debug 文件夹中生成一个 .EXE 文件。

我更像是一名 Web 表单开发人员,所以我对这里发生的事情有点困惑。为什么它是 .EXE 而不是 .DLL?这个文件实际上代表什么?这是 Windows 窗体应用程序的默认行为吗?或者,我的前任必须以某种方式设置它吗?

据我所知,该解决方案没有部署项目。

I have inherited a Windows Forms application and I have found that a .EXE file gets generated into the obj\Debug folder everytime I compile.

I am more a Web Forms kind of developer so I am a little confused as to what is happening here. Why is it a .EXE and not a .DLL? What does this file actually represent? Is this the default behaviour for Windows Forms applications? Or, did my predecessor have to set it up up somehow?

As far as I can tell, the solution does not have a deployment project.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

寂寞花火° 2024-09-16 10:32:35

为什么这是一个问题?控制台应用程序项目的 obj/Debug 文件夹中也有 exe 文件。 obj 文件夹不用于运行应用程序 - 它们用于在 bin 文件夹中创建最终二进制文件。

如果问题是关于 exe 与 dll,则使用编译的 exe 文件来运行应用程序。在 Web 环境中,您使用 dll,因为 ASP.NET 新的如何从它运行代码。但是 Windows 知道如何运行 exe 文件,因此您的任何代码实际上都可以编译为可执行文件。

Why this is a problem? Console application projects have exe file in the obj/Debug folder too. The obj folders are NOT used for running the application - they are used for creating the end binaries in the bin folders.

If the question is about exe vs dll then compiled exe file is used to run the application. In the web environment you used dll because ASP.NET new how to run code from it. But Windows knows how to run exe files, so any of your code actually can be compiled to an executable.

每个应用程序(无论是 Web 应用程序还是 Windows 应用程序)都会有一个执行入口点。 .Net 中编译形式的任何内容都是程序集,不一定总是 DLL 文件。 EXE 文件是一个 .Net 程序集,在文件开头有一个入口点和几个标头,将自身标识为 Windows 操作系统的独立可执行文件。对于 Web 应用程序,您的 ASP.NET 页面是用户在浏览器中键入并启动应用程序的入口点。对于独立的 Windows 窗体桌面应用程序,它是一个可执行文件,用户可以单击运行。

我更像是一名 Web 表单开发人员,所以我对这里发生的事情有点困惑。为什么它是 .EXE 而不是 .DLL?

话虽如此,还需要注意的是,就像 asp.net 不是开发 Web 应用程序的唯一平台一样 [您有 php、jsp 等],.Net Windows 窗体也不是开发 Web 应用程序的唯一方法。创建独立的可执行文件。您可以用 C、C++、VB、Delhpi 等语言创建 EXE。唯一的区别是它们不是 .Net 程序集,但所有这些(包括 .Net 可执行文件)都将有一个开始执行的入口点和 EXE 标头将它们标识为主机 Windows 操作系统上的可执行文件。

Every application be it web or windows would have an entry-point for execution. Anything in compiled form in .Net is an assembly which need not always be a DLL file. An EXE file is a .Net assembly with an entry point and few headers in the beginning of the file that identifies itself as a stand-alone executable to the windows operating system. In case of your web-application your asp.net pages are the entry points that users would type in a browser and start the application. In case of a stand-alone windows forms desktop application, it is an EXECUTABLE file, which user can click on run.

I am more a Web Forms kind of developer so I am a little confused as to what is happening here. Why is it a .EXE and not a .DLL?

Having said this, It is also important to note that, just like the asp.net is not the only platform to develop web-applications [you have php, jsp, etc.], .Net windows forms is also not the only way to create stand-alone executables. You can make EXEs in C, C++, VB, Delhpi, etc. only difference would be that they will not be .Net assemblies but all of them including .Net executables will have an entry-point to start execution from and the EXE header that identifies them as executables on the host windows operating system.

昵称有卵用 2024-09-16 10:32:35

为什么它会是一个DLL?它是一个应用程序 - 它必须是可启动的,与驻留在网络服务器“内部”(有效)的网站不同。 exe 文件是应用程序(当然还有它需要的任何库)。双击它,它将启动该应用程序。没问题。

话虽如此,您几乎应该忽略 obj 目录 - 它只是一个中间目录。 bin 目录是您应该从中获取构建结果的目录。

Why would it be a DLL? It's an application - it has to be launchable, unlike a website which lives "inside" a web server (effectively). The exe file is the application (along with any libraries it requires, of course). You double-click on it, it will launch the application. No problem.

Having said that, you should pretty much ignore the obj directory - it's just an intermediate directory. The bin directory is the one you should be taking build results from.

软糯酥胸 2024-09-16 10:32:34

delhpi 中有多种类型的 win 应用程序。如果您创建 Windows 窗体,则将在调试文件夹中创建 .exe,类似地,如果您创建动态链接库 (DLL),将创建 .dll 文件。每次编译应用程序时都会创建这些文件。

Their are many types of win application in delhpi. If u create windows form, .exe will be craeted in the debug folder similarly if you are creating Dynamic Link Liberary (DLL) .dll files will b created. These files are created each time when you compile the application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文