How to publish a console application (.NET core 5) as a single EXE file in VS 2015 RC?

Currently, there is only one project template for creating a console application based on the .NET core 5 CLR in Visual Studio 2015 RC.

enter image description here

The published application of the above project should look like this. To launch the application, the user needs to double-click "ConsoleApp2.cmd".

enter image description here

The size of the published application is about 50 MB.

enter image description here

I think this project template is not suitable for the ordinary end user. Do you have an idea to publish a console application project in a separate exe file?

Thanks,

+5
source share
2 answers

You have chosen a project type vs based on the DNX SDK. DNX emphasizes a local copy of the dependencies (question size) and an external bootloader call (batch file). This is intentional and will not disappear. When I understand correctly, a batch file can be replaced with a common exe ... But this does not boil down to a single file. DNX is like that.

+2
source

Assuming what you want is exe without the need for .NET.

Not tested, but it seems like you want dotnet compile --native

From: http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx Or maybe more relevant: Building a .NET Core application through the command line so that it works on a computer without installing .NET Core

This is left here for anyone looking for a way to create standalone .NET and will be updated if / when I find a better way to do it

0
source

All Articles