Skip to content

Hello world generates 45MB with publish command #6979

@gradha

Description

@gradha

Steps to reproduce

Write your typical hello world program.

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

And run dotnet publish -c release.

Expected behavior

Generates binary + files worth of several hundreds of KB or maybe 1MB.

Actual behavior

Bundles 45MB of files, including classics like System.Security.Cryptography.X509Certificates.dll for a safer Hello World (hi NSA!).

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
 Version:            1.0.0-preview2-003131
 Commit SHA-1 hash:  635cf40e58

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

Appendix

I'm wondering if there are plans to reduce the size of the generated output and if so what's the expected schedule. Also wondering if it is possible to use dotnet to generate statically lined binaries, aka single file distribution. Not necessarily statically linked in the sense of C low level linkage, but maybe an official way to bundle those .dll into fewer files like python's zip bundle tricks which allow one (at least on unix) to bundle everything into a single file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions