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

后端 未结 1 1142
猫巷女王i
猫巷女王i 2021-01-26 19:03

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

1条回答
  •  礼貌的吻别
    2021-01-26 19:40

    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.

    0 讨论(0)
提交回复
热议问题