I’m migrating from .NET Framework to .NET (Core).
I’ve just realized that .NET Core applications created by VS2022 always have a DLL:
And if I examine my EXE’s details:
Why is the original filename set to the DLL? Can I change it to WinFormsApp2.exe?
With .NET Framework, no DLL was generated, and original filename was always set to the current EXE file. Can I reach this with .NET (Core) too?
>Solution :
In .NET Core, the assembly containing the entry point of your application (i.e., the "main" function) is compiled into a DLL, rather than an EXE like in .NET Framework. This is because .NET Core allows for more flexibility in terms of deployment options, such as running your application as a self-contained executable or as a runtime-dependent executable.
When you build your .NET Core application, the DLL containing the entry point is named after the project and will be the one that the runtime will look for when you run the executable. The executable that you see in the output directory is actually a small wrapper that includes the runtime and the DLL containing the application’s entry point.
It is not possible to change the name of the DLL to match the name of the EXE as it is hard-coded in the runtime. The original filename (in the File Properties) will always reflect the name of the DLL.

