2

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.

igouy
  • 2,547
  • 17
  • 16
  • 1
    Possible duplicate of [How do I build a native binary on .NET Core using the current preview?](http://stackoverflow.com/questions/37308118/how-do-i-build-a-native-binary-on-net-core-using-the-current-preview) – svick May 28 '16 at 22:09

1 Answers1

1

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

krontogiannis
  • 1,819
  • 1
  • 12
  • 17