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 framewor
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.