I would like to configure my dotnet core project to compile as a single executable.
The project is similar to the one generated with dotnet new
:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0"
}
},
"imports": "dnxcore50"
}
},
"runtimes": {
"win10-x64": {}
}
}
How can I make it so this compiles as a single program.exe? When I run dotnet publish
it puts dlls and the program.exe in a publish folder, but doesn't combine them.
NET Core, which natively only allows you to build console apps and web applications, mono allows you to build many application types available in . NET Framework, including GUI-enabled desktop apps. So, if mono can do everything that . NET Core can while .
This is available as of .Net Core 3 like:
dotnet publish -r win10-x64 -p:PublishSingleFile=true
See also https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#single-file-executables
The closest to answer is probably CoreRT
(.Net Core
to Native). It will be excellent fit but exist small problem - This project is still in early apha. A year ago they showed us demo but it was a very simple example and for more advanced projects will not work. Some more information how to try do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With