[英]In netcoreapp3.0 console application, myprogram.exe (with extension exe) is generated by default. What is it?
I have the following simple project: 我有以下简单的项目:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
</Project>
In netcoreapp3.0: 在netcoreapp3.0中:
When run 'dotnet build', I find a file myprogram.dll is generated with size 5k plus myprogram.exe is generated with size 239k 当运行'dotnet build'时,我发现生成了一个大小为5k的myprogram.dll文件,生成了大小为239k的myprogram.exe
In netcoreapp2.2: 在netcoreapp2.2中:
The myprogram.exe isn't generated. 未生成myprogram.exe。
I can run the program : 我可以运行程序:
dotnet myprogram.dll
Or 要么
myprogram.exe //it need .netcore be installed.
Why are the the two files: myprogram.exe and myprogram.dll is generated in netcoreapp3.0, but in netcoreapp2.2 only myprogram.dll is generated? 为什么这两个文件:myprogram.exe和myprogram.dll是在netcoreapp3.0中生成的,但是在netcoreapp2.2中只生成了myprogram.dll?
From https://devblogs.microsoft.com/dotnet/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks/ 来自https://devblogs.microsoft.com/dotnet/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks/
NET Core applications are now built with executables.
NET Core应用程序现在使用可执行文件构建。 This is new for applications that use a globally installed version of .NET Core.
这对于使用全局安装的.NET Core版本的应用程序来说是新的。 Until now, only self-contained applications had executables.
到目前为止,只有自包含的应用程序具有可执行文件。 You can see executables produced in the following examples.
您可以看到以下示例中生成的可执行文件。
You can expect the same things with these executables as you would other native executables, such as:
对于这些可执行文件,您可以期望与其他本机可执行文件相同的内容,例如:
- You can double click on the executable.
您可以双击可执行文件。
- You can launch the application from a command prompt without using the dotnet tool, using myconsole.exe, on Windows, and ./myconsole, on Linux and macOS, as you can see in the following examples.
您可以在不使用dotnet工具的情况下从命令提示符启动应用程序,在Windows上使用myconsole.exe,在Linux和macOS上使用./myconsole,如以下示例所示。
So, it is just a more convenient way to use the program. 因此,它只是一种使用该程序的更方便的方法。 You don't need to use a command line such as
dotnet myapp.dll
to start the application. 您不需要使用命令行(如
dotnet myapp.dll
来启动应用程序。 You can run the exe. 你可以运行exe。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.