Why when compiling .NET Core console application we end up with both dll and exe files?

你说的曾经没有我的故事 提交于 2020-05-16 03:00:10

问题


I have noticed that both dll and exe files with the name of the project are created on Windows when compiling a .NET Core console application. Why is that? In full .Net framework only the exe file would be created.


回答1:


Prior to .Net Core 3.0, only the dll was created (although you could still do a single file build that was platform-dependent). In these cases you had to use the command dotnet MyProject.dll to start your program.

With .Net Core 3.0, they added the exe, which is still really just a wrapper around the command above. On other operating systems it also creates an executable file, it just names it MyProject instead of MyProject.exe

If people have old scripts that still make the dotnet command, this setup doesn't break them, but if you want to just use an exe, you can do that too.



来源:https://stackoverflow.com/questions/61112250/why-when-compiling-net-core-console-application-we-end-up-with-both-dll-and-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!