7

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,

  • 1
    +1 for this. I need to create a dependency wrapped .exe file that can be run without VS and on other windows boxes. – kmehta Jul 06 '15 at 20:17
  • Did you read the description of the project type? it specifically states this project type is a **PREVIEW** and is for installation via **Nu-Get**. If you have questions, comments, or concerns about it you should leave feedback on the Visual Studio UserVoice site. Standard console apps can be created via the *Windows / Console Application* template. – Sam Axe Jul 21 '15 at 21:34
  • @SamAxe I know my question isn't standard way to use this type of project. But I just curious about possibility of this question. If you don't know about .NET core 5 just ignore this question. –  Jul 23 '15 at 06:46

2 Answers2

2

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.

Thomas
  • 5,080
  • 27
  • 42
0

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

Community
  • 1
  • 1
NiKiZe
  • 1,256
  • 10
  • 26
  • @PhilippMunin if you have any information to what is supported would be interesting, or some kind of reference to documentation about it not being supported anymore. – NiKiZe Nov 18 '16 at 09:11
  • 1) https://github.com/dotnet/cli/issues/2803 2) https://github.com/dotnet/cli/issues/2622 – Philipp Munin Nov 18 '16 at 13:04