igouy
igouy

Reputation: 2692

How to compile a Release configuration for Ubuntu console app .NET Core RC2

For example, the hwapp sample builds Debug but not Release:

$ dotnet new
…
$ dotnet restore
…
$ dotnet build
…
$ dotnet ./bin/Debug/netcoreapp1.0/hwapp.dll
Hello World!

What exactly do I have to add to this project.json to get an optimized build?

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },
  "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0-rc2-3002702"
    }
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

My original question may have conflated 2 difference issues - How do I build Release instead of Debug? How do I build with .NET Native?

I've just stumbled over an answer to the first question:

$ dotnet build -c Release

That seems to provide a very obvious performance improvement.

Upvotes: 2

Views: 965

Answers (1)

krontogiannis
krontogiannis

Reputation: 1939

According to this native compilation has been removed from the latest version of the dotnet tools.

Upvotes: 1

Related Questions