user94893
user94893

Reputation:

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

Currently, there is only one project template to create console application based on .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 run application, user need to double click "ConsoleApp2.cmd".

enter image description here

Size of published application is about 50 MB.

enter image description here

I think this project template is inappropriate for normal end-user. Do you have idea to publish console application project to single exe file?

Thanks,

Upvotes: 7

Views: 4152

Answers (2)

NiKiZe
NiKiZe

Reputation: 1432

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

Not tested, but it seems that what you want is dotnet compile --native

From: http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx Or maybe more relevant: Building a .NET Core app via command line, so that it works on a machine without .NET Core installed

This is left here for anyone else looking for a way to create standalone .NET and will be updated if/as I find the best way to do this

Upvotes: 0

Thomas
Thomas

Reputation: 5240

You selected a vs project type based on the DNX SDK. DNX emphasise local copy of the dependencies (your size issue) and invocation by external bootstrapper (the batch file). This is both intentional and will not go away. When I understand right, the batch file might be replaced by a generic exe ... But that will for now not reduce to one file. DNX is like that.

Upvotes: 2

Related Questions